hostnamectl: add -j switch for quick json output

We already support -j as shortcut for JSON mode in various tools. Let's
add one more. We probably should add this systematically (at least where
it doesn't conflict with an existing -j switch with other purpose). But
I am too lazy to add that now.
This commit is contained in:
Lennart Poettering
2024-01-19 15:49:33 +01:00
parent db21c2ec70
commit 2bf618331d
3 changed files with 8 additions and 2 deletions

View File

@@ -35,7 +35,7 @@ _hostnamectl() {
local i verb comps
local cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]}
local -A OPTS=(
[STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password'
[STANDALONE]='-h --help --version --transient --static --pretty --no-ask-password -j'
[ARG]='-H --host -M --machine --json'
)