From f0ab6776d258caa81006c9c7be2c6bb6ab5fe87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 13 Nov 2015 14:15:22 +0100 Subject: [PATCH] [fix] Keep compat with deprecated --plain and --json in the cli --- bin/yunohost | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bin/yunohost b/bin/yunohost index 0474df058..7f1e34dee 100755 --- a/bin/yunohost +++ b/bin/yunohost @@ -74,8 +74,23 @@ def _parse_cli_args(): action='store_true', default=False, help="Don't produce any output", ) + # deprecated arguments + parser.add_argument('--plain', + action='store_true', default=False, help=argparse.SUPPRESS + ) + parser.add_argument('--json', + action='store_true', default=False, help=argparse.SUPPRESS + ) - return (parser,) + parser.parse_known_args() + opts, args = parser.parse_known_args() + + # output compatibility + if opts.plain: + opts.output_as = 'plain' + elif opts.json: + opts.output_as = 'json' + + return (parser, opts, args) def _init_moulinette(debug=False, verbose=False, quiet=False): """Configure logging and initialize the moulinette"""