From df6a62cd03fb59852742e37b4b73df4ef7c75c05 Mon Sep 17 00:00:00 2001 From: Dr Marco Claudio De La Pierre Date: Tue, 10 Oct 2023 14:15:26 +0800 Subject: [PATCH] Update behaviour of `shpc config get` to only show value of key (#661) * client/config.py: use "Unset" when value is not set * shpc config get now only prints value of key, similar to shpc view get Signed-off-by: Marco De La Pierre --- CHANGELOG.md | 1 + shpc/client/config.py | 5 +++-- shpc/version.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9c23ac4e..821f9a5d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and **Merged pull requests**. Critical items to know are: The versions coincide with releases on pip. Only major versions will be released as tags on Github. ## [0.0.x](https://github.com/singularityhub/singularity-hpc/tree/main) (0.0.x) + - Change format of config command output to only show setting values, not keys, for parseability (0.1.25) - Allow custom location for wrapper scripts (0.1.24) - Labels with newlines need additional parsing (0.1.23) - Do not write directly to output with shpc show (0.1.22) diff --git a/shpc/client/config.py b/shpc/client/config.py index 495e33be8..baaca0fcf 100644 --- a/shpc/client/config.py +++ b/shpc/client/config.py @@ -47,8 +47,9 @@ def main(args, parser, extra, subparser): elif command == "get": for key in args.params: value = cli.settings.get(key) - value = "is unset" if value is None else value - logger.info("%s %s" % (key.ljust(30), value)) + value = "unset" if value is None else value + # similar to view get in view.py + print(value) else: logger.error("%s is not a recognized command." % command) diff --git a/shpc/version.py b/shpc/version.py index 43fac3353..25c71bdfa 100644 --- a/shpc/version.py +++ b/shpc/version.py @@ -2,7 +2,7 @@ __copyright__ = "Copyright 2021-2023, Vanessa Sochat" __license__ = "MPL 2.0" -__version__ = "0.1.24" +__version__ = "0.1.25" AUTHOR = "Vanessa Sochat" EMAIL = "vsoch@users.noreply.github.com" NAME = "singularity-hpc"