diff --git a/CHANGELOG.md b/CHANGELOG.md index b90e057df480834e9a434e9b694ac44b405ab3e8..a92bc9206d1b926a0d3295d1baa3bca2bdb3f028 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ changed functionality, fixed bugs). This is only supported on POSIX platforms that have those signals. - Worker can be told to shut down by the Manager. The environment (for example systemd on Linux) is responsible for restarting Flamenco Worker after such a shutdown. +- Added `--version` CLI option to show the version of Flamenco Worker and quit. ## Version 2.0.8 (released 2017-09-07) diff --git a/flamenco_worker/cli.py b/flamenco_worker/cli.py index 4705a991e39bc963109ec957b8a329efd4f05093..d86f77349be7ba1ba937e2f72dadbdc74023e1d6 100644 --- a/flamenco_worker/cli.py +++ b/flamenco_worker/cli.py @@ -17,6 +17,8 @@ def main(): parser.add_argument('-v', '--verbose', action='store_true', help='Show configuration before starting, ' 'and asyncio task status at shutdown.') + parser.add_argument('-V', '--version', action='store_true', + help='Show the version of Flamenco Worker and stops.') parser.add_argument('-r', '--reregister', action='store_true', help="Erases authentication information and re-registers this worker " "at the Manager. WARNING: this can cause duplicate worker information " @@ -27,6 +29,11 @@ def main(): "for more powerful options.") args = parser.parse_args() + if args.version: + from . import __version__ + print(__version__) + raise SystemExit() + # Load configuration from . import config confparser = config.load_config(args.config, args.verbose)