summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-02-05 14:03:59 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-08 08:00:27 +0000
commit943353707bb61ab5e45ee0efb8fd0b8e5a0bce52 (patch)
treed4875b182bc2af9554e8ffdb2b3b6d58592376b3 /scripts
parent7d73324af34e50726f806bc77dfb2d959e9d9e00 (diff)
downloadpoky-943353707bb61ab5e45ee0efb8fd0b8e5a0bce52.tar.gz
devtool: improve command-line help
Based on feedback from Scott Rifenbark <scott.m.rifenbark@intel.com> (From OE-Core rev: ec3378f3a7013e289daa0f5c52329488b861f99c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/devtool18
-rw-r--r--scripts/lib/devtool/standard.py13
2 files changed, 20 insertions, 11 deletions
diff --git a/scripts/devtool b/scripts/devtool
index d6e1b9710d..981ff515d3 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -112,8 +112,8 @@ def read_workspace():
112 break 112 break
113 113
114def create_workspace(args, config, basepath, workspace): 114def create_workspace(args, config, basepath, workspace):
115 if args.directory: 115 if args.layerpath:
116 workspacedir = os.path.abspath(args.directory) 116 workspacedir = os.path.abspath(args.layerpath)
117 else: 117 else:
118 workspacedir = os.path.abspath(os.path.join(basepath, 'workspace')) 118 workspacedir = os.path.abspath(os.path.join(basepath, 'workspace'))
119 _create_workspace(workspacedir, config, basepath, args.create_only) 119 _create_workspace(workspacedir, config, basepath, args.create_only)
@@ -177,18 +177,20 @@ def main():
177 pth = os.path.dirname(pth) 177 pth = os.path.dirname(pth)
178 178
179 parser = argparse.ArgumentParser(description="OpenEmbedded development tool", 179 parser = argparse.ArgumentParser(description="OpenEmbedded development tool",
180 epilog="Use %(prog)s <command> --help to get help on a specific command") 180 epilog="Use %(prog)s <subcommand> --help to get help on a specific command")
181 parser.add_argument('--basepath', help='Base directory of SDK / build directory') 181 parser.add_argument('--basepath', help='Base directory of SDK / build directory')
182 parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true') 182 parser.add_argument('-d', '--debug', help='Enable debug output', action='store_true')
183 parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true') 183 parser.add_argument('-q', '--quiet', help='Print only errors', action='store_true')
184 parser.add_argument('--color', help='Colorize output', choices=['auto', 'always', 'never'], default='auto') 184 parser.add_argument('--color', choices=['auto', 'always', 'never'], default='auto', help='Colorize output (where %(metavar)s is %(choices)s)', metavar='COLOR')
185 185
186 subparsers = parser.add_subparsers(dest="subparser_name") 186 subparsers = parser.add_subparsers(dest="subparser_name", title='subcommands', metavar='<subcommand>')
187 187
188 if not context.fixed_setup: 188 if not context.fixed_setup:
189 parser_create_workspace = subparsers.add_parser('create-workspace', help='Set up a workspace') 189 parser_create_workspace = subparsers.add_parser('create-workspace',
190 parser_create_workspace.add_argument('directory', nargs='?', help='Directory for the workspace') 190 help='Set up a workspace',
191 parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace, do not alter configuration') 191 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.')
192 parser_create_workspace.add_argument('layerpath', nargs='?', help='Path in which the workspace layer should be created')
193 parser_create_workspace.add_argument('--create-only', action="store_true", help='Only create the workspace layer, do not alter configuration')
192 parser_create_workspace.set_defaults(func=create_workspace) 194 parser_create_workspace.set_defaults(func=create_workspace)
193 195
194 scriptutils.load_plugins(logger, plugins, os.path.join(scripts_path, 'lib', 'devtool')) 196 scriptutils.load_plugins(logger, plugins, os.path.join(scripts_path, 'lib', 'devtool'))
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 69bb228487..ae64840062 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -499,6 +499,7 @@ def build(args, config, basepath, workspace):
499 499
500def register_commands(subparsers, context): 500def register_commands(subparsers, context):
501 parser_add = subparsers.add_parser('add', help='Add a new recipe', 501 parser_add = subparsers.add_parser('add', help='Add a new recipe',
502 description='Adds a new recipe',
502 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 503 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
503 parser_add.add_argument('recipename', help='Name for new recipe to add') 504 parser_add.add_argument('recipename', help='Name for new recipe to add')
504 parser_add.add_argument('srctree', help='Path to external source tree') 505 parser_add.add_argument('srctree', help='Path to external source tree')
@@ -506,15 +507,17 @@ def register_commands(subparsers, context):
506 parser_add.set_defaults(func=add) 507 parser_add.set_defaults(func=add)
507 508
508 parser_add = subparsers.add_parser('modify', help='Modify the source for an existing recipe', 509 parser_add = subparsers.add_parser('modify', help='Modify the source for an existing recipe',
510 description='Enables modifying the source for an existing recipe',
509 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 511 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
510 parser_add.add_argument('recipename', help='Name for recipe to edit') 512 parser_add.add_argument('recipename', help='Name for recipe to edit')
511 parser_add.add_argument('srctree', help='Path to external source tree') 513 parser_add.add_argument('srctree', help='Path to external source tree')
512 parser_add.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend') 514 parser_add.add_argument('--wildcard', '-w', action="store_true", help='Use wildcard for unversioned bbappend')
513 parser_add.add_argument('--extract', '-x', action="store_true", help='Extract source as well') 515 parser_add.add_argument('--extract', '-x', action="store_true", help='Extract source as well')
514 parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout') 516 parser_add.add_argument('--branch', '-b', default="devtool", help='Name for development branch to checkout (only when using -x)')
515 parser_add.set_defaults(func=modify) 517 parser_add.set_defaults(func=modify)
516 518
517 parser_add = subparsers.add_parser('extract', help='Extract the source for an existing recipe', 519 parser_add = subparsers.add_parser('extract', help='Extract the source for an existing recipe',
520 description='Extracts the source for an existing recipe',
518 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 521 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
519 parser_add.add_argument('recipename', help='Name for recipe to extract the source for') 522 parser_add.add_argument('recipename', help='Name for recipe to extract the source for')
520 parser_add.add_argument('srctree', help='Path to where to extract the source tree') 523 parser_add.add_argument('srctree', help='Path to where to extract the source tree')
@@ -523,22 +526,26 @@ def register_commands(subparsers, context):
523 parser_add.set_defaults(func=extract) 526 parser_add.set_defaults(func=extract)
524 527
525 parser_add = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe', 528 parser_add = subparsers.add_parser('update-recipe', help='Apply changes from external source tree to recipe',
529 description='Applies changes from external source tree to a recipe (updating/adding/removing patches as necessary)',
526 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 530 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
527 parser_add.add_argument('recipename', help='Name of recipe to update') 531 parser_add.add_argument('recipename', help='Name of recipe to update')
528 parser_add.add_argument('--initial-rev', help='Starting revision for patches') 532 parser_add.add_argument('--initial-rev', help='Starting revision for patches')
529 parser_add.add_argument('--no-remove', '-n', action="store_true", help='Don\'t remove patches, only add or update') 533 parser_add.add_argument('--no-remove', '-n', action="store_true", help='Don\'t remove patches, only add or update')
530 parser_add.set_defaults(func=update_recipe) 534 parser_add.set_defaults(func=update_recipe)
531 535
532 parser_status = subparsers.add_parser('status', help='Show status', 536 parser_status = subparsers.add_parser('status', help='Show workspace status',
537 description='Lists recipes currently in your workspace and the paths to their respective external source trees',
533 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 538 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
534 parser_status.set_defaults(func=status) 539 parser_status.set_defaults(func=status)
535 540
536 parser_build = subparsers.add_parser('build', help='Build recipe', 541 parser_build = subparsers.add_parser('build', help='Build a recipe',
542 description='Builds the specified recipe using bitbake (up to do_install)',
537 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 543 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
538 parser_build.add_argument('recipename', help='Recipe to build') 544 parser_build.add_argument('recipename', help='Recipe to build')
539 parser_build.set_defaults(func=build) 545 parser_build.set_defaults(func=build)
540 546
541 parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace', 547 parser_reset = subparsers.add_parser('reset', help='Remove a recipe from your workspace',
548 description='Removes the specified recipe from your workspace (resetting its state)',
542 formatter_class=argparse.ArgumentDefaultsHelpFormatter) 549 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
543 parser_reset.add_argument('recipename', help='Recipe to reset') 550 parser_reset.add_argument('recipename', help='Recipe to reset')
544 parser_reset.set_defaults(func=reset) 551 parser_reset.set_defaults(func=reset)