diff --git a/project/config/cli.py b/project/config/cli.py index bb4be23..44bf1e9 100644 --- a/project/config/cli.py +++ b/project/config/cli.py @@ -11,7 +11,11 @@ def cli(): @click.argument('key', nargs=-1) def show(key): key = " ".join(key) - print(config.get(key)) + if not key: + for key, value in config.get_all().items(): + print("{}: {}".format(key, value)) + return 0 + print("'{}' is set to '{}'".format(key, config.get(key))) return 0 diff --git a/project/utils/config.py b/project/utils/config.py index ba7d0f0..4ab6aef 100644 --- a/project/utils/config.py +++ b/project/utils/config.py @@ -45,6 +45,13 @@ def get(key): return None +def get_all(): + all_config = {} + for key, value in DEFAULT_CONFIG.items(): + all_config[key] = get(key) + return all_config + + def set(key, value): if key not in DEFAULT_CONFIG: return "NO_KEY"