commit: e6495a131210cbbcefe950804dead16788b2bd74
Author: Sebastian Pipping <sebastian <AT> pipping <DOT> org>
AuthorDate: Sun Feb 21 20:11:57 2016 +0000
Commit: Sebastian Pipping <sping <AT> gentoo <DOT> org>
CommitDate: Sun Feb 21 21:56:02 2016 +0000
URL: https://gitweb.gentoo.org/proj/metagen.git/commit/?id=e6495a13
Introduce speaking options
docs/metagen.1 | 110 ++++++++++++++++++++++++++++++++++++++------------------
metagen/main.py | 24 ++++++-------
2 files changed, 88 insertions(+), 46 deletions(-)
diff --git a/docs/metagen.1 b/docs/metagen.1
index c80d5db..db9f76b 100644
--- a/docs/metagen.1
+++ b/docs/metagen.1
@@ -15,40 +15,82 @@ separate them. See EXAMPLES.
.SH OPTIONS
.\" metagen [OPTIONS]
- -H herd
- Name of herd.
-
- -e email-address
- Package maintainer's email address
-
- -n maintainer-name
- Package maintainer's name (used with -e option)
-
- -m
- Uses ECHANGELOG_USER variable. Can be used instead of -e and -n
-
- -d description
- Description of maintainership (used with -e option)
-
- -l long-description
- Long description of package.
-
- -o output-file
- Write to <output-file> instead of ./metadata.xml
-
- -f
- Force overwrite of existing metadata
-
- -v
- Write to stdout as well as disk (default)
-
- -q
- Don't write to stdout
-
- -Q
- Don't write file to disk
-
- -h, --help show this help message and exit
+.B --herd
+|
+.B
+-H
+herd
+ Name of herd.
+
+.B --email
+|
+.B
+-e
+email-address
+ Package maintainer's email address
+
+.B --name
+|
+.B
+-n
+maintainer-name
+ Package maintainer's name (used with -e option)
+
+.B --echangelog
+|
+.B
+-m
+ Uses ECHANGELOG_USER variable. Can be used instead of -e and -n
+
+.B --desc
+|
+.B
+-d
+description
+ Description of maintainership (used with -e option)
+
+.B --long
+|
+.B
+-l
+long-description
+ Long description of package.
+
+.B --output
+|
+.B
+-o
+output-file
+ Write to <output-file> instead of ./metadata.xml
+
+.B --force
+|
+.B
+-f
+ Force overwrite of existing metadata
+
+.B --verbose
+|
+.B
+-v
+ Write to stdout as well as disk (default)
+
+.B --quiet
+|
+.B
+-q
+ Don't write to stdout
+
+.B -Q
+ Don't write file to disk
+
+.B --help
+|
+.B -h
+ show usage help and exit
+
+.B --version
+ show version and exit
.SH EXAMPLES
.B metagen -H python
diff --git a/metagen/main.py b/metagen/main.py
index 1648f92..671bd02 100755
--- a/metagen/main.py
+++ b/metagen/main.py
@@ -114,33 +114,33 @@ if __name__ == '__main__':
parser.add_argument('--version', action='version', version='%(prog)s ' +
__version__)
maintainer = parser.add_argument_group(title='maintainer arguments')
- maintainer.add_argument("-H", action="store", dest="herd",
+ maintainer.add_argument("--herd", "-H", action="store",
help="Name of herd. If not specified, It will be
empty. " +
"This requires either the -e or -m option.")
- maintainer.add_argument("-e", action="store", dest="email",
+ maintainer.add_argument("--email", "-e", action="store",
help="Maintainer's email address")
- maintainer.add_argument("-n", action="store", dest="name",
+ maintainer.add_argument("--name", "-n", action="store",
help="Maintainer's name")
- maintainer.add_argument("-m", action="store_true", dest="echangelog",
+ maintainer.add_argument("--echangelog", "-m", action="store_true",
default=False,
help="Use name and email address from ECHANGELOG_USER
"+
"environmental variable. "+
"This is a shortcut for -e <email> -n <name>")
- maintainer.add_argument("-d", action="store", dest="desc",
+ maintainer.add_argument("--desc", "-d", action="store",
help="Description of maintainership")
- package = parser.add_argument_group(title='package arguments')
- package.add_argument("-l", action="store", dest="long",
+ package = parser.add_argument_group(title='package arguments',
description=None)
+ package.add_argument("--long", "-l", action="store",
help="Long description of package.")
- operation = parser.add_argument_group(title='operation arguments')
- operation.add_argument("-o", action="store", dest="output",
+ operation = parser.add_argument_group(title='operation arguments',
description=None)
+ operation.add_argument("--output", "-o", action="store",
help="Specify location of output file.")
- operation.add_argument("-f", action="store_true", dest="force",
default=False,
+ operation.add_argument("--force", "-f", action="store_true", default=False,
help="Force overwrite of existing metadata.")
- operation.add_argument("-v", action="store_true", dest="verbose",
default=True,
+ operation.add_argument("--verbose", "-v", action="store_true",
default=True,
help="Verbose. Output of file to stdout. (default)")
- operation.add_argument("-q", action="store_false", dest="verbose",
+ operation.add_argument("--quiet", "-q", action="store_false",
dest="verbose",
help="Squelch output of file to stdout.")
operation.add_argument("-Q", action="store_true", dest="no_write",
default=False,