cli: reflect changes in moulinette

This commit is contained in:
Alexandre Aubin 2022-12-23 20:35:02 +01:00
parent d7ee1c23f3
commit ba60ece609
2 changed files with 7 additions and 8 deletions

View file

@ -24,6 +24,9 @@ def _parse_cli_args():
parser.add_argument(
"--quiet", action="store_true", default=False, help="Don't produce any output"
)
parser.add_argument(
"--version", action="store_true", default=False, help="Display YunoHost packages versions (alias to 'yunohost tools versions')"
)
parser.add_argument(
"--timeout",
type=int,
@ -50,6 +53,7 @@ def _parse_cli_args():
# Stupid PATH management because sometimes (e.g. some cron job) PATH is only /usr/bin:/bin ...
default_path = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
if os.environ["PATH"] != default_path:
os.environ["PATH"] = default_path + ":" + os.environ["PATH"]
@ -66,6 +70,9 @@ if __name__ == "__main__":
parser, opts, args = _parse_cli_args()
if opts.version:
args = ["tools", "versions"]
# Execute the action
yunohost.cli(
debug=opts.debug,

View file

@ -37,14 +37,6 @@ _global:
authentication:
api: ldap_admin
cli: null
arguments:
-v:
full: --version
help: Display YunoHost packages versions
action: callback
callback:
method: yunohost.utils.system.ynh_packages_version
return: true
#############################
# User #