From 346e5a164faa3bfa75fd61e97891cc0ba9a012e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Sat, 16 Apr 2016 20:02:01 +0200 Subject: [PATCH] [enh] Allow to not output result from the cli --- moulinette/interfaces/cli.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moulinette/interfaces/cli.py b/moulinette/interfaces/cli.py index 3623e96f..f9e04d7a 100644 --- a/moulinette/interfaces/cli.py +++ b/moulinette/interfaces/cli.py @@ -326,10 +326,11 @@ class Interface(BaseInterface): - output_as -- Output result in another format. Possible values: - json: return a JSON encoded string - plain: return a script-readable output + - none: do not output the result - 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')) # auto-complete @@ -345,7 +346,7 @@ class Interface(BaseInterface): except KeyboardInterrupt, EOFError: raise MoulinetteError(errno.EINTR, m18n.g('operation_interrupted')) - if ret is None: + if ret is None or output_as == 'none': return # Format and print result