From 44591d1169c85526e5586ff1905abb393c865d51 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Fri, 7 Aug 2020 17:35:56 -0400 Subject: [PATCH] cli: add `--help` usage and description in command help texts Signed-off-by: Philippe Proulx --- barectf/cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/barectf/cli.py b/barectf/cli.py index e39c861..846d546 100644 --- a/barectf/cli.py +++ b/barectf/cli.py @@ -155,10 +155,12 @@ def _print_gen_cmd_usage(): [--metadata-dir=DIR] [--prefix=PREFIX] [--include-dir=DIR]... [--ignore-include-not-found] CONFIG-FILE-PATH + barectf generate --help Options: -c DIR, --code-dir=DIR Write C source files to DIR instead of the CWD -H DIR, --headers-dir=DIR Write C header files to DIR instead of the CWD + -h, --help Show this help and quit --ignore-include-not-found Continue to process the configuration file when included files are not found -I DIR, --include-dir=DIR Add DIR to the list of directories to be @@ -215,8 +217,10 @@ def _show_effective_cfg_cmd_usage(): print('''Usage: barectf show-effective-configuration [--include-dir=DIR]... [--ignore-include-not-found] [--indent-spaces=COUNT] CONFIG-FILE-PATH + barectf show-effective-configuration --help Options: + -h, --help Show this help and quit --ignore-include-not-found Continue to process the configuration file when included files are not found -I DIR, --include-dir=DIR Add DIR to the list of directories to be @@ -264,7 +268,11 @@ def _show_effective_cfg_cfg_from_args(orig_args): def _show_cfg_version_cmd_usage(): - print('Usage: barectf show-configuration-version CONFIG-FILE-PATH') + print('''Usage: barectf show-configuration-version CONFIG-FILE-PATH + barectf show-configuration-version --help + +Options: + -h, --help Show this help and quit''') # Returns a configuration version showing command object from the -- 2.34.1