diff options
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/lib/wic/help.py | 56 | ||||
| -rwxr-xr-x | scripts/wic | 8 |
2 files changed, 61 insertions, 3 deletions
diff --git a/scripts/lib/wic/help.py b/scripts/lib/wic/help.py index af7d0576e2..968cc0ed6f 100644 --- a/scripts/lib/wic/help.py +++ b/scripts/lib/wic/help.py | |||
| @@ -1046,3 +1046,59 @@ NAME | |||
| 1046 | DESCRIPTION | 1046 | DESCRIPTION |
| 1047 | Specify a help topic to display it. Topics are shown above. | 1047 | Specify a help topic to display it. Topics are shown above. |
| 1048 | """ | 1048 | """ |
| 1049 | |||
| 1050 | |||
| 1051 | wic_help = """ | ||
| 1052 | Creates a customized OpenEmbedded image. | ||
| 1053 | |||
| 1054 | Usage: wic [--version] | ||
| 1055 | wic help [COMMAND or TOPIC] | ||
| 1056 | wic COMMAND [ARGS] | ||
| 1057 | |||
| 1058 | usage 1: Returns the current version of Wic | ||
| 1059 | usage 2: Returns detailed help for a COMMAND or TOPIC | ||
| 1060 | usage 3: Executes COMMAND | ||
| 1061 | |||
| 1062 | |||
| 1063 | COMMAND: | ||
| 1064 | |||
| 1065 | list - List available canned images and source plugins | ||
| 1066 | ls - List contents of partitioned image or partition | ||
| 1067 | rm - Remove files or directories from the vfat or ext* partitions | ||
| 1068 | help - Show help for a wic COMMAND or TOPIC | ||
| 1069 | write - Write an image to a device | ||
| 1070 | cp - Copy files and directories to the vfat or ext* partitions | ||
| 1071 | create - Create a new OpenEmbedded image | ||
| 1072 | |||
| 1073 | |||
| 1074 | TOPIC: | ||
| 1075 | overview - Presents an overall overview of Wic | ||
| 1076 | plugins - Presents an overview and API for Wic plugins | ||
| 1077 | kickstart - Presents a Wic kicstart file reference | ||
| 1078 | |||
| 1079 | |||
| 1080 | Examples: | ||
| 1081 | |||
| 1082 | $ wic --version | ||
| 1083 | |||
| 1084 | Returns the current version of Wic | ||
| 1085 | |||
| 1086 | |||
| 1087 | $ wic help cp | ||
| 1088 | |||
| 1089 | Returns the SYNOPSIS and DESCRIPTION for the Wic "cp" command. | ||
| 1090 | |||
| 1091 | |||
| 1092 | $ wic list images | ||
| 1093 | |||
| 1094 | Returns the list of canned images (i.e. *.wks files located in | ||
| 1095 | the /scripts/lib/wic/canned-wks directory. | ||
| 1096 | |||
| 1097 | |||
| 1098 | $ wic create mkefidisk -e core-image-minimal | ||
| 1099 | |||
| 1100 | Creates an EFI disk image from artifacts used in a previous | ||
| 1101 | core-image-minimal build in standard BitBake locations | ||
| 1102 | (e.g. Cooked Mode). | ||
| 1103 | |||
| 1104 | """ | ||
diff --git a/scripts/wic b/scripts/wic index 1d89fb2eda..1a717300f5 100755 --- a/scripts/wic +++ b/scripts/wic | |||
| @@ -495,14 +495,18 @@ def init_parser(parser): | |||
| 495 | subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2]) | 495 | subparser = subparsers.add_parser(subcmd, help=subcommands[subcmd][2]) |
| 496 | subcommands[subcmd][3](subparser) | 496 | subcommands[subcmd][3](subparser) |
| 497 | 497 | ||
| 498 | class WicArgumentParser(argparse.ArgumentParser): | ||
| 499 | def format_help(self): | ||
| 500 | return hlp.wic_help | ||
| 498 | 501 | ||
| 499 | def main(argv): | 502 | def main(argv): |
| 500 | parser = argparse.ArgumentParser( | 503 | parser = WicArgumentParser( |
| 501 | description="wic version %s" % __version__) | 504 | description="wic version %s" % __version__) |
| 502 | 505 | ||
| 503 | init_parser(parser) | 506 | init_parser(parser) |
| 504 | 507 | ||
| 505 | args = parser.parse_args(argv) | 508 | args = parser.parse_args(argv) |
| 509 | |||
| 506 | if args.debug: | 510 | if args.debug: |
| 507 | logger.setLevel(logging.DEBUG) | 511 | logger.setLevel(logging.DEBUG) |
| 508 | 512 | ||
| @@ -510,8 +514,6 @@ def main(argv): | |||
| 510 | if args.command == "help": | 514 | if args.command == "help": |
| 511 | if args.help_topic is None: | 515 | if args.help_topic is None: |
| 512 | parser.print_help() | 516 | parser.print_help() |
| 513 | print() | ||
| 514 | print("Please specify a help topic") | ||
| 515 | elif args.help_topic in helptopics: | 517 | elif args.help_topic in helptopics: |
| 516 | hlpt = helptopics[args.help_topic] | 518 | hlpt = helptopics[args.help_topic] |
| 517 | hlpt[0](hlpt[1], hlpt[2]) | 519 | hlpt[0](hlpt[1], hlpt[2]) |
