aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/recipetool
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-13 16:01:30 +1200
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-06-13 16:13:14 +1200
commit21633d8f3c95add3368d782ad8fb4cb2540e97f2 (patch)
tree0904482a542005dd5bec7416d1e6d70c95548962 /scripts/recipetool
parent51df8170189201b5141824cdd19274c491a41899 (diff)
downloadopenembedded-core-contrib-21633d8f3c95add3368d782ad8fb4cb2540e97f2.tar.gz
scripts: ensure not specifying subcommand shows help textpaule/devtool17-oe
With Python 2, argparse subparsers behaviour in Python 2 was to print the usage information if the subparsers argument wasn't specified. However, with Python 3.2.3 and later a subparsers argument is not required by default, leading to errors when no arguments are specified: AttributeError: 'Namespace' object has no attribute 'func' Restore the previous desired behaviour of showing the help text for devtool, recipetool and the devtool-stress script by setting subparsers.required to True. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/recipetool')
-rwxr-xr-xscripts/recipetool1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/recipetool b/scripts/recipetool
index 0e8bffb5c0..17233d4ef0 100755
--- a/scripts/recipetool
+++ b/scripts/recipetool
@@ -60,6 +60,7 @@ def main():
parser.add_argument('-h', '--help', action='help', default=argparse.SUPPRESS,
help='show this help message and exit')
subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>')
+ subparsers.required = True
if global_args.debug:
logger.setLevel(logging.DEBUG)