1 |
commit: e6495a131210cbbcefe950804dead16788b2bd74 |
2 |
Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org> |
3 |
AuthorDate: Sun Feb 21 20:11:57 2016 +0000 |
4 |
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Feb 21 21:56:02 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/metagen.git/commit/?id=e6495a13 |
7 |
|
8 |
Introduce speaking options |
9 |
|
10 |
docs/metagen.1 | 110 ++++++++++++++++++++++++++++++++++++++------------------ |
11 |
metagen/main.py | 24 ++++++------- |
12 |
2 files changed, 88 insertions(+), 46 deletions(-) |
13 |
|
14 |
diff --git a/docs/metagen.1 b/docs/metagen.1 |
15 |
index c80d5db..db9f76b 100644 |
16 |
--- a/docs/metagen.1 |
17 |
+++ b/docs/metagen.1 |
18 |
@@ -15,40 +15,82 @@ separate them. See EXAMPLES. |
19 |
|
20 |
.SH OPTIONS |
21 |
.\" metagen [OPTIONS] |
22 |
- -H herd |
23 |
- Name of herd. |
24 |
- |
25 |
- -e email-address |
26 |
- Package maintainer's email address |
27 |
- |
28 |
- -n maintainer-name |
29 |
- Package maintainer's name (used with -e option) |
30 |
- |
31 |
- -m |
32 |
- Uses ECHANGELOG_USER variable. Can be used instead of -e and -n |
33 |
- |
34 |
- -d description |
35 |
- Description of maintainership (used with -e option) |
36 |
- |
37 |
- -l long-description |
38 |
- Long description of package. |
39 |
- |
40 |
- -o output-file |
41 |
- Write to <output-file> instead of ./metadata.xml |
42 |
- |
43 |
- -f |
44 |
- Force overwrite of existing metadata |
45 |
- |
46 |
- -v |
47 |
- Write to stdout as well as disk (default) |
48 |
- |
49 |
- -q |
50 |
- Don't write to stdout |
51 |
- |
52 |
- -Q |
53 |
- Don't write file to disk |
54 |
- |
55 |
- -h, --help show this help message and exit |
56 |
+.B --herd |
57 |
+| |
58 |
+.B |
59 |
+-H |
60 |
+herd |
61 |
+ Name of herd. |
62 |
+ |
63 |
+.B --email |
64 |
+| |
65 |
+.B |
66 |
+-e |
67 |
+email-address |
68 |
+ Package maintainer's email address |
69 |
+ |
70 |
+.B --name |
71 |
+| |
72 |
+.B |
73 |
+-n |
74 |
+maintainer-name |
75 |
+ Package maintainer's name (used with -e option) |
76 |
+ |
77 |
+.B --echangelog |
78 |
+| |
79 |
+.B |
80 |
+-m |
81 |
+ Uses ECHANGELOG_USER variable. Can be used instead of -e and -n |
82 |
+ |
83 |
+.B --desc |
84 |
+| |
85 |
+.B |
86 |
+-d |
87 |
+description |
88 |
+ Description of maintainership (used with -e option) |
89 |
+ |
90 |
+.B --long |
91 |
+| |
92 |
+.B |
93 |
+-l |
94 |
+long-description |
95 |
+ Long description of package. |
96 |
+ |
97 |
+.B --output |
98 |
+| |
99 |
+.B |
100 |
+-o |
101 |
+output-file |
102 |
+ Write to <output-file> instead of ./metadata.xml |
103 |
+ |
104 |
+.B --force |
105 |
+| |
106 |
+.B |
107 |
+-f |
108 |
+ Force overwrite of existing metadata |
109 |
+ |
110 |
+.B --verbose |
111 |
+| |
112 |
+.B |
113 |
+-v |
114 |
+ Write to stdout as well as disk (default) |
115 |
+ |
116 |
+.B --quiet |
117 |
+| |
118 |
+.B |
119 |
+-q |
120 |
+ Don't write to stdout |
121 |
+ |
122 |
+.B -Q |
123 |
+ Don't write file to disk |
124 |
+ |
125 |
+.B --help |
126 |
+| |
127 |
+.B -h |
128 |
+ show usage help and exit |
129 |
+ |
130 |
+.B --version |
131 |
+ show version and exit |
132 |
|
133 |
.SH EXAMPLES |
134 |
.B metagen -H python |
135 |
|
136 |
diff --git a/metagen/main.py b/metagen/main.py |
137 |
index 1648f92..671bd02 100755 |
138 |
--- a/metagen/main.py |
139 |
+++ b/metagen/main.py |
140 |
@@ -114,33 +114,33 @@ if __name__ == '__main__': |
141 |
parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) |
142 |
|
143 |
maintainer = parser.add_argument_group(title='maintainer arguments') |
144 |
- maintainer.add_argument("-H", action="store", dest="herd", |
145 |
+ maintainer.add_argument("--herd", "-H", action="store", |
146 |
help="Name of herd. If not specified, It will be empty. " + |
147 |
"This requires either the -e or -m option.") |
148 |
- maintainer.add_argument("-e", action="store", dest="email", |
149 |
+ maintainer.add_argument("--email", "-e", action="store", |
150 |
help="Maintainer's email address") |
151 |
- maintainer.add_argument("-n", action="store", dest="name", |
152 |
+ maintainer.add_argument("--name", "-n", action="store", |
153 |
help="Maintainer's name") |
154 |
- maintainer.add_argument("-m", action="store_true", dest="echangelog", |
155 |
+ maintainer.add_argument("--echangelog", "-m", action="store_true", |
156 |
default=False, |
157 |
help="Use name and email address from ECHANGELOG_USER "+ |
158 |
"environmental variable. "+ |
159 |
"This is a shortcut for -e <email> -n <name>") |
160 |
- maintainer.add_argument("-d", action="store", dest="desc", |
161 |
+ maintainer.add_argument("--desc", "-d", action="store", |
162 |
help="Description of maintainership") |
163 |
|
164 |
- package = parser.add_argument_group(title='package arguments') |
165 |
- package.add_argument("-l", action="store", dest="long", |
166 |
+ package = parser.add_argument_group(title='package arguments', description=None) |
167 |
+ package.add_argument("--long", "-l", action="store", |
168 |
help="Long description of package.") |
169 |
|
170 |
- operation = parser.add_argument_group(title='operation arguments') |
171 |
- operation.add_argument("-o", action="store", dest="output", |
172 |
+ operation = parser.add_argument_group(title='operation arguments', description=None) |
173 |
+ operation.add_argument("--output", "-o", action="store", |
174 |
help="Specify location of output file.") |
175 |
- operation.add_argument("-f", action="store_true", dest="force", default=False, |
176 |
+ operation.add_argument("--force", "-f", action="store_true", default=False, |
177 |
help="Force overwrite of existing metadata.") |
178 |
- operation.add_argument("-v", action="store_true", dest="verbose", default=True, |
179 |
+ operation.add_argument("--verbose", "-v", action="store_true", default=True, |
180 |
help="Verbose. Output of file to stdout. (default)") |
181 |
- operation.add_argument("-q", action="store_false", dest="verbose", |
182 |
+ operation.add_argument("--quiet", "-q", action="store_false", dest="verbose", |
183 |
help="Squelch output of file to stdout.") |
184 |
operation.add_argument("-Q", action="store_true", dest="no_write", |
185 |
default=False, |