aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Pipping <sebastian@pipping.org>2016-02-21 20:52:17 +0100
committerSebastian Pipping <sebastian@pipping.org>2016-02-21 22:53:07 +0100
commit8f51fde869db377563e9554db7bed6288b42a9cc (patch)
tree217a558197c8dd7e3b840ed4ede9b4b31caa06f5
parentMinimal migration to argparse (diff)
downloadmetagen-8f51fde869db377563e9554db7bed6288b42a9cc.tar.gz
metagen-8f51fde869db377563e9554db7bed6288b42a9cc.tar.bz2
metagen-8f51fde869db377563e9554db7bed6288b42a9cc.zip
Group command line arguments
-rwxr-xr-xmetagen/main.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/metagen/main.py b/metagen/main.py
index d243c24..1648f92 100755
--- a/metagen/main.py
+++ b/metagen/main.py
@@ -113,41 +113,36 @@ if __name__ == '__main__':
parser = ArgumentParser(prog='metagen')
parser.add_argument('--version', action='version', version='%(prog)s ' + __version__)
- parser.add_argument("-H", action="store", dest="herd",
+ maintainer = parser.add_argument_group(title='maintainer arguments')
+ maintainer.add_argument("-H", action="store", dest="herd",
help="Name of herd. If not specified, It will be empty. " +
"This requires either the -e or -m option.")
-
- parser.add_argument("-e", action="store", dest="email",
+ maintainer.add_argument("-e", action="store", dest="email",
help="Maintainer's email address")
-
- parser.add_argument("-n", action="store", dest="name",
+ maintainer.add_argument("-n", action="store", dest="name",
help="Maintainer's name")
-
- parser.add_argument("-m", action="store_true", dest="echangelog",
+ maintainer.add_argument("-m", action="store_true", dest="echangelog",
default=False,
help="Use name and email address from ECHANGELOG_USER "+
"environmental variable. "+
"This is a shortcut for -e <email> -n <name>")
-
- parser.add_argument("-d", action="store", dest="desc",
+ maintainer.add_argument("-d", action="store", dest="desc",
help="Description of maintainership")
- parser.add_argument("-l", action="store", dest="long",
+ package = parser.add_argument_group(title='package arguments')
+ package.add_argument("-l", action="store", dest="long",
help="Long description of package.")
- parser.add_argument("-o", action="store", dest="output",
+ operation = parser.add_argument_group(title='operation arguments')
+ operation.add_argument("-o", action="store", dest="output",
help="Specify location of output file.")
-
- parser.add_argument("-f", action="store_true", dest="force", default=False,
+ operation.add_argument("-f", action="store_true", dest="force", default=False,
help="Force overwrite of existing metadata.")
-
- parser.add_argument("-v", action="store_true", dest="verbose", default=True,
+ operation.add_argument("-v", action="store_true", dest="verbose", default=True,
help="Verbose. Output of file to stdout. (default)")
-
- parser.add_argument("-q", action="store_false", dest="verbose",
+ operation.add_argument("-q", action="store_false", dest="verbose",
help="Squelch output of file to stdout.")
-
- parser.add_argument("-Q", action="store_true", dest="no_write",
+ operation.add_argument("-Q", action="store_true", dest="no_write",
default=False,
help="Do not write file to disk.")