From 943353707bb61ab5e45ee0efb8fd0b8e5a0bce52 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Thu, 5 Feb 2015 14:03:59 +0000 Subject: devtool: improve command-line help Based on feedback from Scott Rifenbark (From OE-Core rev: ec3378f3a7013e289daa0f5c52329488b861f99c) Signed-off-by: Paul Eggleton Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/devtool | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'scripts/devtool') 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(): 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 --help to get help on a specific command") + epilog="Use %(prog)s --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='') 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')) -- cgit v1.2.3-54-g00ecf