mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Keep compat with deprecated --plain and --json in the cli
This commit is contained in:
parent
2db80b3294
commit
f0ab6776d2
1 changed files with 16 additions and 1 deletions
17
bin/yunohost
17
bin/yunohost
|
@ -74,8 +74,23 @@ def _parse_cli_args():
|
||||||
action='store_true', default=False,
|
action='store_true', default=False,
|
||||||
help="Don't produce any output",
|
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):
|
def _init_moulinette(debug=False, verbose=False, quiet=False):
|
||||||
"""Configure logging and initialize the moulinette"""
|
"""Configure logging and initialize the moulinette"""
|
||||||
|
|
Loading…
Add table
Reference in a new issue