From 714bc8e39f1b250c3be82ecd49d2bf339e37a505 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 8 May 2013 21:38:14 +0100 Subject: [PATCH] update.py: error out with unexpected arguments It's easy to forget you need to use -l to specify the list of layers to update and previously we just ignored unused arguments, so check for them and error out if present. Signed-off-by: Paul Eggleton --- TODO | 1 - layerindex/update.py | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index a6cab46..43e5fe2 100644 --- a/TODO +++ b/TODO @@ -2,7 +2,6 @@ TODO: * Duplication of first maintainer when editing to add a second? * Try to re-use existing recipe record with same PN instead of deleting and re-creating (if within same layer) -* Update script should error out with extra unused parameters - too easy to forget to use -l with layer list * meta-arago-extras is preferred over meta-networking e.g. for crda; probably need an explicit field for priority order * Update script does not report which layer failed with -q when fetch fails * Document macros for URL fields diff --git a/layerindex/update.py b/layerindex/update.py index 1582d80..c32d8cc 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -179,6 +179,10 @@ def main(): options, args = parser.parse_args(sys.argv) + if len(args) > 1: + logger.error('unexpected argument "%s"' % args[1]) + parser.print_help() + sys.exit(1) # Get access to our Django model newpath = os.path.abspath(os.path.dirname(os.path.abspath(sys.argv[0])) + '/..')