mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 14:17:46 +00:00
Add convenient "config printvalue" command
This commit is contained in:
parent
bccbd58e20
commit
b84b0a6eed
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Latest
|
## Latest
|
||||||
|
|
||||||
|
- [Feature] Add convenient `config printvalue` command
|
||||||
- [Feature] Customize docker registry
|
- [Feature] Customize docker registry
|
||||||
- [Feature] Load configuration parameters from the system environment
|
- [Feature] Load configuration parameters from the system environment
|
||||||
- [Improvement] Automatic environment re-generation after re-configuration
|
- [Improvement] Automatic environment re-generation after re-configuration
|
||||||
|
@ -42,6 +42,18 @@ def save(root, silent, set_):
|
|||||||
def printroot(root):
|
def printroot(root):
|
||||||
click.echo(root)
|
click.echo(root)
|
||||||
|
|
||||||
|
@click.command(help="Print a configuration value")
|
||||||
|
@opts.root
|
||||||
|
@click.argument("key")
|
||||||
|
def printvalue(root, key):
|
||||||
|
config = {}
|
||||||
|
load_current(config, root)
|
||||||
|
load_defaults(config)
|
||||||
|
try:
|
||||||
|
print(config[key])
|
||||||
|
except KeyError:
|
||||||
|
raise exceptions.TutorError("Missing configuration value: {}".format(key))
|
||||||
|
|
||||||
def load(root):
|
def load(root):
|
||||||
"""
|
"""
|
||||||
Load configuration, and generate it interactively if the file does not
|
Load configuration, and generate it interactively if the file does not
|
||||||
@ -200,3 +212,4 @@ def config_path(root):
|
|||||||
|
|
||||||
config.add_command(save)
|
config.add_command(save)
|
||||||
config.add_command(printroot)
|
config.add_command(printroot)
|
||||||
|
config.add_command(printvalue)
|
||||||
|
Loading…
Reference in New Issue
Block a user