diff --git a/CHANGELOG.md b/CHANGELOG.md index 6059d93..20218fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.14.1] - 2019-10-04 ### Added +- Added version flag to CLI, PR #79. [@maikefischer](github.com/maikefischer) - Prohibit ncores < 1, PR #76 [@annakau](https://github.com/annakau) ### Changed diff --git a/fast_carpenter/__main__.py b/fast_carpenter/__main__.py index cc68d4d..fa538ce 100644 --- a/fast_carpenter/__main__.py +++ b/fast_carpenter/__main__.py @@ -11,6 +11,7 @@ from .event_builder import EventBuilder from atsge.build_parallel import build_parallel from .utils import mkdir_p +from .version import __version__ atup.EventBuilder = EventBuilder atup.build_parallel = build_parallel logging.getLogger(__name__).setLevel(logging.INFO) @@ -56,6 +57,7 @@ def __call__(self, parser, namespace, values, option_string=None): help="Print help specific to the available stages") parser.add_argument("--help-stages-full", action=StagesHelp, metavar="stage", help="Print the full help specific to the available stages") + parser.add_argument("-v", "--version", action="version", version='%(prog)s ' + __version__) return parser