Unverified Commit d6952f67 authored by mathieui's avatar mathieui

Rename hidden -v option to --custom-version and add a real -v (#3429)

parent 34f6ad1b
...@@ -25,5 +25,5 @@ else ...@@ -25,5 +25,5 @@ else
fi fi
$PYTHON3 -c 'import sys;(print("Python 3.5 or newer is required") and exit(1)) if sys.version_info < (3, 5) else exit(0)' || exit 1 $PYTHON3 -c 'import sys;(print("Python 3.5 or newer is required") and exit(1)) if sys.version_info < (3, 5) else exit(0)' || exit 1
exec "$PYTHON3" -m poezio -v "$args" "$@" exec "$PYTHON3" -m poezio --custom-version "$args" "$@"
...@@ -6,6 +6,8 @@ There is a fallback to the deprecated optparse if argparse is not found ...@@ -6,6 +6,8 @@ There is a fallback to the deprecated optparse if argparse is not found
from pathlib import Path from pathlib import Path
from argparse import ArgumentParser, SUPPRESS from argparse import ArgumentParser, SUPPRESS
from poezio.version import __version__
def parse_args(CONFIG_PATH: Path): def parse_args(CONFIG_PATH: Path):
""" """
...@@ -33,11 +35,17 @@ def parse_args(CONFIG_PATH: Path): ...@@ -33,11 +35,17 @@ def parse_args(CONFIG_PATH: Path):
help="The config file you want to use", help="The config file you want to use",
metavar="CONFIG_FILE") metavar="CONFIG_FILE")
parser.add_argument( parser.add_argument(
"-v", '-v',
"--version", '--version',
dest="version", action='version',
version='Poezio v%s' % __version__,
)
parser.add_argument(
"--custom-version",
dest="custom_version",
help=SUPPRESS, help=SUPPRESS,
metavar="VERSION", metavar="VERSION",
default="0.13-dev") default=__version__
)
options = parser.parse_args() options = parser.parse_args()
return options return options
...@@ -177,7 +177,7 @@ class Connection(slixmpp.ClientXMPP): ...@@ -177,7 +177,7 @@ class Connection(slixmpp.ClientXMPP):
self.register_plugin('xep_0196') self.register_plugin('xep_0196')
if config.get('send_poezio_info'): 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'): if config.get('send_os_info'):
info['os'] = common.get_os_info() info['os'] = common.get_os_info()
self.plugin['xep_0030'].set_identities(identities={('client', self.plugin['xep_0030'].set_identities(identities={('client',
......
__version__ = '0.13-dev'
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment