--mode full/export -> --full / --export

This commit is contained in:
Alexandre Aubin 2021-09-05 18:53:39 +02:00
parent 6276385120
commit 62eecb28db
2 changed files with 19 additions and 9 deletions

View file

@ -863,14 +863,14 @@ app:
key: key:
help: A specific panel, section or a question identifier help: A specific panel, section or a question identifier
nargs: '?' nargs: '?'
-m: -f:
full: --mode full: --full
help: Display mode to use help: Display all details (meant to be used by the API)
choices: action: store_true
- classic -e:
- full full: --export
- export help: Only export key/values, meant to be reimported using "config set --args-file"
default: classic action: store_true
### app_config_set() ### app_config_set()
set: set:

View file

@ -1751,10 +1751,20 @@ def app_action_run(operation_logger, app, action, args=None):
return logger.success("Action successed!") return logger.success("Action successed!")
def app_config_get(app, key="", mode="classic"): def app_config_get(app, key="", full=False, export=False):
""" """
Display an app configuration in classic, full or export mode Display an app configuration in classic, full or export mode
""" """
if full and export:
raise YunohostValidationError("You can't use --full and --export together.", raw_msg=True)
if full:
mode = "full"
elif export:
mode = "export"
else:
mode = "classic"
config_ = AppConfigPanel(app) config_ = AppConfigPanel(app)
return config_.get(key, mode) return config_.get(key, mode)