diff --git a/docs/release-process.md b/docs/release-process.md index 62af0e6..6260129 100644 --- a/docs/release-process.md +++ b/docs/release-process.md @@ -1,6 +1,6 @@ # Release Process -1. Bump version number in `pyproject.toml`, generate the setup.py file, and git tag release +1. Bump version number in `pyproject.toml` and `hwilib/__init__.py`, generate the setup.py file, and git tag release 2. Build distribution archives for PyPi with `contrib/build_dist.sh` 3. For MacOS and Linux, use `contrib/build_bin.sh`. This needs to be run on a MacOS machine for the MacOS binary and on a Linux machine for the linux one. 4. For Windows, use `contrib/build_wine.sh` to build the Windows binary using wine diff --git a/hwilib/__init__.py b/hwilib/__init__.py index e69de29..eead319 100644 --- a/hwilib/__init__.py +++ b/hwilib/__init__.py @@ -0,0 +1 @@ +__version__ = '0.0.5' diff --git a/hwilib/cli.py b/hwilib/cli.py index 4aef73f..f2f74fb 100644 --- a/hwilib/cli.py +++ b/hwilib/cli.py @@ -11,6 +11,7 @@ from .errors import ( UNKNWON_DEVICE_TYPE, UNKNOWN_ERROR ) +from . import __version__ import argparse import getpass @@ -58,7 +59,7 @@ def send_pin_handler(args, client): return send_pin(client, pin=args.pin) def process_commands(args): - parser = argparse.ArgumentParser(description='Access and send commands to a hardware wallet device. Responses are in JSON format') + parser = argparse.ArgumentParser(description='Hardware Wallet Interface, version {}.\nAccess and send commands to a hardware wallet device. Responses are in JSON format.'.format(__version__), formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('--device-path', '-d', help='Specify the device path of the device to connect to') parser.add_argument('--device-type', '-t', help='Specify the type of device that will be connected. If `--device-path` not given, the first device of this type enumerated is used.') parser.add_argument('--password', '-p', help='Device password if it has one (e.g. DigitalBitbox)', default='') @@ -66,6 +67,7 @@ def process_commands(args): parser.add_argument('--testnet', help='Use testnet prefixes', action='store_true') parser.add_argument('--debug', help='Print debug statements', action='store_true') parser.add_argument('--fingerprint', '-f', help='Specify the device to connect to using the first 4 bytes of the hash160 of the master public key. It will connect to the first device that matches this fingerprint.') + parser.add_argument('--version', action='version', version='%(prog)s {}'.format(__version__)) subparsers = parser.add_subparsers(description='Commands', dest='command') # work-around to make subparser required