diff options
author | mathieui <mathieui@mathieui.net> | 2019-02-24 15:41:16 +0100 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2019-02-24 15:41:16 +0100 |
commit | d6952f675b1aed39a2e1c505613392fd36f0e13a (patch) | |
tree | 436dcb3dda77d63cc75e72354508ce63ea46cffb /poezio | |
parent | 34f6ad1baceffb8608e53a3206edb565c23781ea (diff) | |
download | poezio-d6952f675b1aed39a2e1c505613392fd36f0e13a.tar.gz poezio-d6952f675b1aed39a2e1c505613392fd36f0e13a.tar.bz2 poezio-d6952f675b1aed39a2e1c505613392fd36f0e13a.tar.xz poezio-d6952f675b1aed39a2e1c505613392fd36f0e13a.zip |
Rename hidden -v option to --custom-version and add a real -v (#3429)
Diffstat (limited to 'poezio')
-rw-r--r-- | poezio/args.py | 16 | ||||
-rw-r--r-- | poezio/connection.py | 2 | ||||
-rw-r--r-- | poezio/version.py | 1 |
3 files changed, 14 insertions, 5 deletions
diff --git a/poezio/args.py b/poezio/args.py index d0005d82..e1ebe5e0 100644 --- a/poezio/args.py +++ b/poezio/args.py @@ -6,6 +6,8 @@ There is a fallback to the deprecated optparse if argparse is not found from pathlib import Path from argparse import ArgumentParser, SUPPRESS +from poezio.version import __version__ + def parse_args(CONFIG_PATH: Path): """ @@ -33,11 +35,17 @@ def parse_args(CONFIG_PATH: Path): help="The config file you want to use", metavar="CONFIG_FILE") parser.add_argument( - "-v", - "--version", - dest="version", + '-v', + '--version', + action='version', + version='Poezio v%s' % __version__, + ) + parser.add_argument( + "--custom-version", + dest="custom_version", help=SUPPRESS, metavar="VERSION", - default="0.13-dev") + default=__version__ + ) options = parser.parse_args() return options diff --git a/poezio/connection.py b/poezio/connection.py index 57254069..d56b6c52 100644 --- a/poezio/connection.py +++ b/poezio/connection.py @@ -177,7 +177,7 @@ class Connection(slixmpp.ClientXMPP): self.register_plugin('xep_0196') if config.get('send_poezio_info'): - info = {'name': 'poezio', 'version': options.version} + info = {'name': 'poezio', 'version': options.custom_version} if config.get('send_os_info'): info['os'] = common.get_os_info() self.plugin['xep_0030'].set_identities(identities={('client', diff --git a/poezio/version.py b/poezio/version.py new file mode 100644 index 00000000..3543a785 --- /dev/null +++ b/poezio/version.py @@ -0,0 +1 @@ +__version__ = '0.13-dev' |