public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH 1/3] main: group related command line flags
@ 2015-10-09  5:57 Mike Frysinger
  2015-10-09  5:57 ` [gentoo-catalyst] [PATCH 2/3] log: new logging module to standardize catalyst output Mike Frysinger
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mike Frysinger @ 2015-10-09  5:57 UTC (permalink / raw
  To: gentoo-catalyst

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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-10-09 16:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-09  5:57 [gentoo-catalyst] [PATCH 1/3] main: group related command line flags Mike Frysinger
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox