devtool/recipetool command-line help fixes
cover devtool/recipetool command-line help fixes
The following changes since commit eb9d896db2fc67bac8efd258744d06fbbee87f06:
libtool: avoid running automake/autoconf --version (2015-02-05 09:45:49 +0000)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/devtool-cmdline-help
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/devtool-cmdline-help
Paul Eggleton (2):
devtool: improve command-line help
recipetool: improve command-line help
scripts/devtool | 18 ++++++++++-------- scripts/lib/devtool/standard.py | 13 ++++++++++--- scripts/lib/recipetool/create.py | 8 +++++--- scripts/recipetool | 6 +++--- 4 files changed, 28 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.3
PATCH 1/2 devtool: improve command-line help
Based on feedback from Scott Rifenbark <[email protected]>
Signed-off-by Paul Eggleton <[email protected]>
--- scripts/devtool | 18 ++++++++++-------- scripts/lib/devtool/standard.py | 13 ++++++++++--- 2 files changed, 20 insertions(+), 11 deletions(-)
scripts/devtool +10 -8
@@ -112,8 +112,8 @@ def read_workspace(): break def create_workspace(args, config, basepath, workspace): - if args.directory: - workspacedir = os.path.abspath(args.directory) + if args.layerpath: + workspacedir = os.path.abspath(args.layerpath) else: workspacedir = os.path.abspath(os.path.join(basepath, 'workspace')) _create_workspace(workspacedir, config, basepath, args.create_only)
@@ -177,18 +177,20 @@ def main(): pth = os.path.dirname(pth) parser = argparse.ArgumentParser(description="OpenEmbedded development tool", - epilog="Use %(prog)s <command> --help to get help on a specific command") + epilog="Use %(prog)s <subcommand> --help to get help on a specific command") parser.add_argument('--basepath', help='Base directory of SDK / build directory') parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') - parser.add_argument('--color', help='Colorize output', choices=['auto', 'always', 'never'], default='auto') + parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') - subparsers = parser.add_subparsers(dest="subparser_name") + subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>') if not context.fixed_setup: - parser_create_workspace = subparsers.add_parser('create-workspace', help='Set up a workspace') - parser_create_workspace.add_argument('directory', nargs='?', help='Directory for the workspace') - parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace, do not alter configuration') + parser_create_workspace = subparsers.add_parser('create-workspace', + help='Set up a workspace', + description='Sets up a new workspace. NOTE: other devtool subcommands will create a workspace automatically as needed, so you only need to use %(prog)s if you want to specify where the workspace should be located.') + parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created') + parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration') parser_create_workspace.set_defaults(func=create_workspace) scriptutils.load_plugins(logger, plugins, os.path.join(scripts_path, 'lib', 'devtool'))
scripts/lib/devtool/standard.py +10 -3
@@ -499,6 +499,7 @@ def build(args, config, basepath, workspace): def register_commands(subparsers, context): parser_add = subparsers.add_parser('add', help='Add a new recipe', + description='Adds a new recipe', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_add.add_argument('recipename', help='Name for new recipe to add') parser_add.add_argument('srctree', help='Path to external source tree')
@@ -506,15 +507,17 @@ def register_commands(subparsers, context): parser_add.set_defaults(func=add) parser_add = subparsers.add_parser('modify', help='Modify the source for an existing recipe', + description='Enables modifying the source for an existing recipe', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_add.add_argument('recipename', help='Name for recipe to edit') parser_add.add_argument('srctree', help='Path to external source tree') parser_add.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') parser_add.add_argument('--extract', '-x', action="store_true", help='Extract source as well') - parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout') + parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)') parser_add.set_defaults(func=modify) parser_add = subparsers.add_parser('extract', help='Extract the source for an existing recipe', + description='Extracts the source for an existing recipe', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_add.add_argument('recipename', help='Name for recipe to extract the source for') parser_add.add_argument('srctree', help='Path to where to extract the source tree')
@@ -523,22 +526,26 @@ def register_commands(subparsers, context): parser_add.set_defaults(func=extract) parser_add = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe', + description='Applies changes from external source tree to a recipe (updating/adding/removing patches as necessary)', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_add.add_argument('recipename', help='Name of recipe to update') parser_add.add_argument('--initial-rev', help='Starting revision for patches') parser_add.add_argument('--no-remove', '-n', action="store_true", help='Don\'t remove patches, only add or update') parser_add.set_defaults(func=update_recipe) - parser_status = subparsers.add_parser('status', help='Show status', + parser_status = subparsers.add_parser('status', help='Show workspace status', + description='Lists recipes currently in your workspace and the paths to their respective external source trees', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_status.set_defaults(func=status) - parser_build = subparsers.add_parser('build', help='Build recipe', + parser_build = subparsers.add_parser('build', help='Build a recipe', + description='Builds the specified recipe using bitbake (up to do_install)', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_build.add_argument('recipename', help='Recipe to build') parser_build.set_defaults(func=build) parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace', + description='Removes the specified recipe from your workspace (resetting its state)', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser_reset.add_argument('recipename', help='Recipe to reset') parser_reset.set_defaults(func=reset)
Signature · 1 line
1.9.3
PATCH 2/2 recipetool: improve command-line help
In reply to Paul EggletonBased on feedback from Scott Rifenbark <[email protected]>
Signed-off-by Paul Eggleton <[email protected]>
--- scripts/lib/recipetool/create.py | 8 +++++--- scripts/recipetool | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-)
scripts/lib/recipetool/create.py +5 -3
@@ -406,10 +406,12 @@ def convert_debian(debpath): def register_command(subparsers): - parser_create = subparsers.add_parser('create', help='Create a new recipe') + parser_create = subparsers.add_parser('create', + help='Create a new recipe', + description='Creates a new recipe from a source tree') parser_create.add_argument('source', help='Path or URL to source') - parser_create.add_argument('-o', '--outfile', help='Full path and filename to recipe to add', required=True) + parser_create.add_argument('-o', '--outfile', help='Specify filename for recipe to create', required=True) parser_create.add_argument('-m', '--machine', help='Make recipe machine-specific as opposed to architecture-specific', action='store_true') - parser_create.add_argument('-x', '--externalsrc', help='Assuming source is a URL, fetch it and extract it to the specified directory') + parser_create.add_argument('-x', '--extract-to', metavar='EXTRACTPATH', help='Assuming source is a URL, fetch it and extract it to the directory specified as %(metavar)s') parser_create.set_defaults(func=create_recipe)
scripts/recipetool +3 -3
@@ -49,11 +49,11 @@ def main(): sys.exit(1) parser = argparse.ArgumentParser(description="OpenEmbedded recipe tool", - epilog="Use %(prog)s <command> --help to get help on a specific command") + epilog="Use %(prog)s <subcommand> --help to get help on a specific command") parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') - parser.add_argument('--color', help='Colorize output', choices=['auto', 'always', 'never'], default='auto') - subparsers = parser.add_subparsers() + parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR') + subparsers = parser.add_subparsers(title='subcommands', metavar='<subcommand>') scriptutils.load_plugins(logger, plugins, os.path.join(scripts_path, 'lib', 'recipetool')) registered = False
Signature · 1 line
1.9.3