mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
cli: reflect changes in moulinette
This commit is contained in:
parent
d7ee1c23f3
commit
ba60ece609
2 changed files with 7 additions and 8 deletions
|
@ -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,
|
||||
|
|
|
@ -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 #
|
||||
|
|
Loading…
Add table
Reference in a new issue