mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
[enh] Allow to not output result from the cli
This commit is contained in:
parent
b8964091dd
commit
346e5a164f
1 changed files with 3 additions and 2 deletions
|
@ -326,10 +326,11 @@ class Interface(BaseInterface):
|
||||||
- output_as -- Output result in another format. Possible values:
|
- output_as -- Output result in another format. Possible values:
|
||||||
- json: return a JSON encoded string
|
- json: return a JSON encoded string
|
||||||
- plain: return a script-readable output
|
- plain: return a script-readable output
|
||||||
|
- none: do not output the result
|
||||||
- password -- The password to use in case of authentication
|
- password -- The password to use in case of authentication
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if output_as and output_as not in ['json', 'plain']:
|
if output_as and output_as not in ['json', 'plain', 'none']:
|
||||||
raise MoulinetteError(errno.EINVAL, m18n.g('invalid_usage'))
|
raise MoulinetteError(errno.EINVAL, m18n.g('invalid_usage'))
|
||||||
|
|
||||||
# auto-complete
|
# auto-complete
|
||||||
|
@ -345,7 +346,7 @@ class Interface(BaseInterface):
|
||||||
except KeyboardInterrupt, EOFError:
|
except KeyboardInterrupt, EOFError:
|
||||||
raise MoulinetteError(errno.EINTR, m18n.g('operation_interrupted'))
|
raise MoulinetteError(errno.EINTR, m18n.g('operation_interrupted'))
|
||||||
|
|
||||||
if ret is None:
|
if ret is None or output_as == 'none':
|
||||||
return
|
return
|
||||||
|
|
||||||
# Format and print result
|
# Format and print result
|
||||||
|
|
Loading…
Add table
Reference in a new issue