1 |
commit: 8f51fde869db377563e9554db7bed6288b42a9cc |
2 |
Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org> |
3 |
AuthorDate: Sun Feb 21 19:52:17 2016 +0000 |
4 |
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 21 21:53:07 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/metagen.git/commit/?id=8f51fde8 |
7 |
|
8 |
Group command line arguments |
9 |
|
10 |
metagen/main.py | 33 ++++++++++++++------------------- |
11 |
1 file changed, 14 insertions(+), 19 deletions(-) |
12 |
|
13 |
diff --git a/metagen/main.py b/metagen/main.py |
14 |
index d243c24..1648f92 100755 |
15 |
--- a/metagen/main.py |
16 |
+++ b/metagen/main.py |
17 |
@@ -113,41 +113,36 @@ if __name__ == '__main__': |
18 |
parser = ArgumentParser(prog='metagen') |
19 |
parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) |
20 |
|
21 |
- parser.add_argument("-H", action="store", dest="herd", |
22 |
+ maintainer = parser.add_argument_group(title='maintainer arguments') |
23 |
+ maintainer.add_argument("-H", action="store", dest="herd", |
24 |
help="Name of herd. If not specified, It will be empty. " + |
25 |
"This requires either the -e or -m option.") |
26 |
- |
27 |
- parser.add_argument("-e", action="store", dest="email", |
28 |
+ maintainer.add_argument("-e", action="store", dest="email", |
29 |
help="Maintainer's email address") |
30 |
- |
31 |
- parser.add_argument("-n", action="store", dest="name", |
32 |
+ maintainer.add_argument("-n", action="store", dest="name", |
33 |
help="Maintainer's name") |
34 |
- |
35 |
- parser.add_argument("-m", action="store_true", dest="echangelog", |
36 |
+ maintainer.add_argument("-m", action="store_true", dest="echangelog", |
37 |
default=False, |
38 |
help="Use name and email address from ECHANGELOG_USER "+ |
39 |
"environmental variable. "+ |
40 |
"This is a shortcut for -e <email> -n <name>") |
41 |
- |
42 |
- parser.add_argument("-d", action="store", dest="desc", |
43 |
+ maintainer.add_argument("-d", action="store", dest="desc", |
44 |
help="Description of maintainership") |
45 |
|
46 |
- parser.add_argument("-l", action="store", dest="long", |
47 |
+ package = parser.add_argument_group(title='package arguments') |
48 |
+ package.add_argument("-l", action="store", dest="long", |
49 |
help="Long description of package.") |
50 |
|
51 |
- parser.add_argument("-o", action="store", dest="output", |
52 |
+ operation = parser.add_argument_group(title='operation arguments') |
53 |
+ operation.add_argument("-o", action="store", dest="output", |
54 |
help="Specify location of output file.") |
55 |
- |
56 |
- parser.add_argument("-f", action="store_true", dest="force", default=False, |
57 |
+ operation.add_argument("-f", action="store_true", dest="force", default=False, |
58 |
help="Force overwrite of existing metadata.") |
59 |
- |
60 |
- parser.add_argument("-v", action="store_true", dest="verbose", default=True, |
61 |
+ operation.add_argument("-v", action="store_true", dest="verbose", default=True, |
62 |
help="Verbose. Output of file to stdout. (default)") |
63 |
- |
64 |
- parser.add_argument("-q", action="store_false", dest="verbose", |
65 |
+ operation.add_argument("-q", action="store_false", dest="verbose", |
66 |
help="Squelch output of file to stdout.") |
67 |
- |
68 |
- parser.add_argument("-Q", action="store_true", dest="no_write", |
69 |
+ operation.add_argument("-Q", action="store_true", dest="no_write", |
70 |
default=False, |
71 |
help="Do not write file to disk.") |