From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 1/3] main: group related command line flags
Date: Fri, 9 Oct 2015 01:57:26 -0400 [thread overview]
Message-ID: <1444370248-13159-1-git-send-email-vapier@gentoo.org> (raw)
This makes the --help output more manageable so people can quickly
scan and skip options that they don't care about.
---
catalyst/main.py | 48 ++++++++++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 20 deletions(-)
diff --git a/catalyst/main.py b/catalyst/main.py
index 03c13c0..e6b6447 100644
--- a/catalyst/main.py
+++ b/catalyst/main.py
@@ -168,41 +168,49 @@ Using the specfile option (-f, --file) to build a stage target:
$ catalyst -f stage1-specfile.spec"""
parser = argparse.ArgumentParser(epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter)
- parser.add_argument('-d', '--debug',
+
+ parser.add_argument('-V', '--version',
+ action='version', version=get_version(),
+ help='display version information')
+
+ group = parser.add_argument_group('Program output options')
+ group.add_argument('-d', '--debug',
default=False, action='store_true',
help='enable debugging')
- parser.add_argument('-v', '--verbose',
+ group.add_argument('-v', '--verbose',
default=False, action='store_true',
help='verbose output')
- parser.add_argument('-c', '--config',
- type=FilePath(),
- help='use specified configuration file')
- parser.add_argument('-f', '--file',
- type=FilePath(),
- help='read specfile')
- parser.add_argument('-F', '--fetchonly',
- default=False, action='store_true',
- help='fetch files only')
- parser.add_argument('-a', '--clear-autoresume',
+
+ group = parser.add_argument_group('Temporary file management')
+ group.add_argument('-a', '--clear-autoresume',
default=False, action='store_true',
help='clear autoresume flags')
- parser.add_argument('-p', '--purge',
+ group.add_argument('-p', '--purge',
default=False, action='store_true',
help='clear tmp dirs, package cache, autoresume flags')
- parser.add_argument('-P', '--purgeonly',
+ group.add_argument('-P', '--purgeonly',
default=False, action='store_true',
help='clear tmp dirs, package cache, autoresume flags and exit')
- parser.add_argument('-T', '--purgetmponly',
+ group.add_argument('-T', '--purgetmponly',
default=False, action='store_true',
help='clear tmp dirs and autoresume flags and exit')
- parser.add_argument('-s', '--snapshot',
+
+ group = parser.add_argument_group('Target/config file management')
+ group.add_argument('-F', '--fetchonly',
+ default=False, action='store_true',
+ help='fetch files only')
+ group.add_argument('-c', '--config',
+ type=FilePath(),
+ help='use specified configuration file')
+ group.add_argument('-f', '--file',
+ type=FilePath(),
+ help='read specfile')
+ group.add_argument('-s', '--snapshot',
help='generate a release snapshot')
- parser.add_argument('-V', '--version',
- action='version', version=get_version(),
- help='display version information')
- parser.add_argument('-C', '--cli',
+ group.add_argument('-C', '--cli',
default=[], nargs=argparse.REMAINDER,
help='catalyst commandline (MUST BE LAST OPTION)')
+
return parser
--
2.5.2
next reply other threads:[~2015-10-09 5:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-09 5:57 Mike Frysinger [this message]
2015-10-09 5:57 ` [gentoo-catalyst] [PATCH 2/3] log: new logging module to standardize catalyst output Mike Frysinger
2015-10-09 16:30 ` Brian Dolbec
2015-10-09 5:57 ` [gentoo-catalyst] [PATCH 3/3] main: convert to new logging module Mike Frysinger
2015-10-09 16:32 ` Brian Dolbec
2015-10-09 16:19 ` [gentoo-catalyst] [PATCH 1/3] main: group related command line flags Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1444370248-13159-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=gentoo-catalyst@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox