run-autopkgtest: Require --trigger argument, improve help

This commit is contained in:
Martin Pitt 2015-10-26 09:19:05 +01:00
parent 0e3434ddbd
commit 02c4e76c64

View File

@ -24,13 +24,23 @@ def parse_args():
help='Only run test(s) on given architecture name(s). '
'Can be specified multiple times (default: all).')
parser.add_argument('--trigger', action='append', default=[],
metavar='SOURCE/VERSION', required=True,
help='Add triggering package to request. '
'Can be specified multiple times.')
parser.add_argument('--ppa', metavar='LPUSER/PPANAME',
help='Enable PPA for requested test(s)')
parser.add_argument('package', nargs='+',
help='Source package name(s) whose tests to run.')
return parser.parse_args()
args = parser.parse_args()
# verify syntax of triggers
for t in args.trigger:
try:
(src, ver) = t.split('/')
except ValueError:
parser.error('Invalid trigger format "%s", must be "sourcepkg/version"' % t)
return args
def parse_config(config_file):