diff --git a/bin/yunohost b/bin/yunohost index afa3df7ec..3f985e6e7 100755 --- a/bin/yunohost +++ b/bin/yunohost @@ -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, diff --git a/share/actionsmap.yml b/share/actionsmap.yml index cbfe16841..f6a64f265 100644 --- a/share/actionsmap.yml +++ b/share/actionsmap.yml @@ -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 #