]> code.ossystems Code Review - openembedded-core.git/commit
scripts: ensure not specifying subcommand shows help text
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Mon, 13 Jun 2016 04:43:41 +0000 (16:43 +1200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 14 Jun 2016 11:56:32 +0000 (12:56 +0100)
commitd36fdea1a7f32d97187e0e9e6d701ae8fa304e8f
tree7bd15158e85951c2a6120955d8a289dcccd8c57b
parentad92ed8e4f7f48a3d212962531d596b36f6b284f
scripts: ensure not specifying subcommand shows help text

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>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/contrib/devtool-stress.py
scripts/devtool
scripts/recipetool