]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fix(shell-completion): discard error messages 38210/head
authorEisuke Kawashima <e-kwsm@users.noreply.github.com>
Mon, 14 Jul 2025 07:06:08 +0000 (16:06 +0900)
committerEisuke Kawashima <e-kwsm@users.noreply.github.com>
Mon, 14 Jul 2025 11:24:26 +0000 (20:24 +0900)
18 files changed:
shell-completion/bash/journalctl
shell-completion/bash/loginctl
shell-completion/bash/networkctl
shell-completion/bash/resolvectl
shell-completion/bash/run0
shell-completion/bash/systemctl.in
shell-completion/bash/systemd-analyze
shell-completion/bash/systemd-cgls
shell-completion/bash/systemd-nspawn
shell-completion/bash/systemd-path
shell-completion/bash/systemd-resolve
shell-completion/bash/systemd-run
shell-completion/bash/userdbctl
shell-completion/zsh/_coredumpctl
shell-completion/zsh/_loginctl
shell-completion/zsh/_machinectl
shell-completion/zsh/_resolvectl
shell-completion/zsh/_systemd-analyze

index 31e8e0d935b27a0acf994f40f0615513f96e5f02..be0239ea659994eb938215ac3fa53ae3fed46f4d 100644 (file)
@@ -81,7 +81,7 @@ _journalctl() {
                 comps=$( journalctl --output=help 2>/dev/null )
                 ;;
             --field|-F)
-                comps=$(journalctl --fields | sort 2>/dev/null)
+                comps=$(journalctl --fields 2>/dev/null | sort)
                 ;;
             --machine|-M)
                 comps=$( __get_machines )
index f0e1196e6156407b9e1b903211057dd813b99f53..d38221b67708ccfa399d98b4611fcef5a60ac34a 100644 (file)
@@ -26,9 +26,9 @@ __contains_word () {
     done
 }
 
-__get_all_sessions () { loginctl --no-legend list-sessions | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
-__get_all_users    () { loginctl --no-legend list-users    | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
-__get_all_seats    () { loginctl --no-legend list-seats    | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
+__get_all_sessions () { loginctl --no-legend list-sessions 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
+__get_all_users    () { loginctl --no-legend list-users    2>/dev/null | { while read -r a b; do printf "%s\n" "$b"; done; } ; }
+__get_all_seats    () { loginctl --no-legend list-seats    2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; } ; }
 
 __get_machines() {
     local a b
index 41f1b573cc9068f8c198afee56366ad03374732b..c16768079e30e71e4fae828fe4dbe6de12bdcc1d 100644 (file)
@@ -26,7 +26,7 @@ __contains_word () {
 }
 
 __get_links() {
-    networkctl list --no-legend --no-pager --all --full | { while read -r a b c; do echo " $b"; done; }
+    networkctl list --no-legend --no-pager --all --full 2>/dev/null | { while read -r a b c; do echo " $b"; done; }
 }
 
 __get_links_with_prefix() {
@@ -70,7 +70,7 @@ _networkctl() {
     if __contains_word "$prev" ${OPTS[ARG]}; then
         case $prev in
             --json)
-                comps=$(networkctl --json=help)
+                comps=$(networkctl --json=help 2>/dev/null)
                 ;;
             *)
                 return 0
index b561a72301a0d29bd394679138c32d69bd34e851..9a3c25c9902825bccaa0ee693a295b3231a048f0 100644 (file)
@@ -67,7 +67,7 @@ _resolvectl() {
                 comps=$( __get_interfaces )
                 ;;
             --protocol|-p|--type|-t|--class|-c|--json)
-                comps=$( resolvectl --legend=no "$prev" help; echo help )
+                comps=$( resolvectl --legend=no "$prev" help 2>/dev/null; echo help )
                 ;;
             --raw)
                 comps="payload packet"
index fe2efedd309b116511e0c461480689b242fe0ea8..0850b6ef9628e350e30b5f2c091db05683e9bd5c 100644 (file)
@@ -21,7 +21,7 @@ __systemctl() {
     systemctl --system --full --no-legend --no-pager --plain "$@"
 }
 
-__get_slice_units () { __systemctl list-units --all -t slice |
+__get_slice_units () { __systemctl list-units --all -t slice 2>/dev/null |
                            { while read -r a b c d; do echo " $a"; done; }; }
 
 __get_machines() {
index 1004ac60431d42decc5f5350edbc25922a3e2d41..cbca727ceec293eab6bce948afb31cba87a2102f 100644 (file)
@@ -13,7 +13,7 @@ __systemctl() {
 }
 
 __systemd_properties() {
-    {{LIBEXECDIR}}/systemd --dump-bus-properties
+    {{LIBEXECDIR}}/systemd --dump-bus-properties 2>/dev/null
 }
 
 __contains_word () {
index 24478dd3bf8a5d6a182755a665e634940d1ebd96..8329b1b495be22c720a21289cb7c7f43bc5cc72d 100644 (file)
@@ -34,18 +34,18 @@ __get_machines() {
 }
 
 __get_units_all() {
-    systemctl list-units --no-legend --no-pager --plain --all $1 |
+    systemctl list-units --no-legend --no-pager --plain --all $1 2>/dev/null |
         { while read -r a b c; do echo " $a"; done; }
 }
 
 __get_services() {
-    systemctl list-units --no-legend --no-pager --plain -t service --all $1 |
+    systemctl list-units --no-legend --no-pager --plain -t service --all $1 2>/dev/null |
         { while read -r a b c; do [[ $b == "loaded" ]] && echo " $a"; done; }
 }
 
 __get_syscall_sets() {
     local line
-    systemd-analyze syscall-filter --no-pager | while IFS= read -r line; do
+    systemd-analyze syscall-filter --no-pager 2>/dev/null | while IFS= read -r line; do
         if [[ $line == @* ]]; then
             printf '%s\n' "$line"
         fi
@@ -53,7 +53,7 @@ __get_syscall_sets() {
 }
 
 __get_architectures() {
-    systemd-analyze --no-legend --no-pager architectures | { while read -r a b; do echo " $a"; done; }
+    systemd-analyze --no-legend --no-pager architectures 2>/dev/null | { while read -r a b; do echo " $a"; done; }
 }
 
 _systemd_analyze() {
index 2ec843f04647b0c32b197602fcd61e31a020315c..aa30e7082e933b9acdef572a7ac0b1bc33052b82 100644 (file)
@@ -32,7 +32,7 @@ __get_machines() {
 }
 
 __get_units_have_cgroup() {
-    systemctl $1 --full --no-legend --no-pager --plain list-units | {
+    systemctl $1 --full --no-legend --no-pager --plain list-units 2>/dev/null | {
         while read -r a b c d; do
             [[ $c == "active" && ${a##*.} =~ (service|socket|mount|swap|slice|scope) ]] && echo " $a"
         done
index 49164fb90c3c8dbc0c138ea9d98ab1a9c9ca0d9a..574018b1fff209e794c3c3fdf7991ae6abfc86a0 100644 (file)
@@ -26,12 +26,14 @@ __contains_word() {
 
 __get_users() {
     local a b
-    loginctl list-users --no-legend --no-pager | { while read -r a b; do echo " $b"; done; }
+    loginctl list-users --no-legend --no-pager 2>/dev/null |
+        { while read -r a b; do echo " $b"; done; }
 }
 
 __get_slices() {
     local a b
-    systemctl list-units -t slice --no-legend --no-pager --plain | { while read -r a b; do echo " $a"; done; }
+    systemctl list-units -t slice --no-legend --no-pager --plain 2>/dev/null |
+        { while read -r a b; do echo " $a"; done; }
 }
 
 __get_machines() {
index 59d6597d06b147b3f39c1bd81e711d9e94deaa98..2b62a0d9854b172b633f030ed3c3750050c9c784 100644 (file)
@@ -26,7 +26,7 @@ __contains_word () {
 }
 
 __get_names() {
-    systemd-path | { while IFS=: read -r a b; do echo " $a"; done; }
+    systemd-path 2>/dev/null | { while IFS=: read -r a b; do echo " $a"; done; }
 }
 
 _systemd_path() {
index 17890a9a0941138eb5217f1a7065590aa37a58e4..791c0f541f918035e9628a85c8fdfc114f389046 100644 (file)
@@ -50,7 +50,7 @@ _systemd-resolve() {
                 comps=$( __get_interfaces )
                 ;;
             --protocol|-p|--type|-t|--class|-c)
-                comps=$( systemd-resolve --legend=no "$prev" help; echo help )
+                comps=$( systemd-resolve --legend=no "$prev" help 2>/dev/null; echo help )
                 ;;
             --raw)
                 comps="payload packet"
index e1a14ff2b053b35d939e3640e7f50ab603974c19..ba8f84b513b3258641d0fb51b0266b0c296fd18e 100644 (file)
@@ -22,7 +22,7 @@ __systemctl() {
     systemctl $mode --full --no-legend --no-pager --plain "$@"
 }
 
-__get_slice_units () { __systemctl $1 list-units --all -t slice |
+__get_slice_units () { __systemctl $1 list-units --all -t slice 2>/dev/null |
                            { while read -r a b c d; do echo " $a"; done; }; }
 
 __get_properties () {
@@ -31,7 +31,7 @@ __get_properties () {
 }
 
 __get_path_properties () {
-    systemd-analyze transient-settings path |
+    systemd-analyze transient-settings path 2>/dev/null |
         while read -r p; do [ -z "$p" ] || echo "$p="; done
 }
 
index b068fe81fdba4bb7444d3f584951cf8b386c6890..514487f2e78d356b9fa684bfa06132bcfd64d924 100644 (file)
@@ -28,12 +28,12 @@ __contains_word () {
 
 __get_all_users () {
     local a b
-    userdbctl user --no-legend -B | { while read -r a b; do printf "%s\n" "$a"; done; }
+    userdbctl user --no-legend -B 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; }
 }
 
 __get_all_groups () {
     local a b
-    userdbctl group --no-legend -B | { while read -r a b; do printf "%s\n" "$a"; done; }
+    userdbctl group --no-legend -B 2>/dev/null | { while read -r a b; do printf "%s\n" "$a"; done; }
 }
 
 _userdbctl () {
index 7472626069587931c0e00b87a39950d5603cade1..b288e0895f23ab27ce0b305f92e0e7c3f92fdf8e 100644 (file)
@@ -17,7 +17,7 @@ _coredumpctl_commands(){
         local -a _dumps
         cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
         if (( $#cmd  )); then
-            _dumps=( "${(f)$(coredumpctl list -q --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}' 2>/dev/null)}" )
+            _dumps=( "${(f)$(coredumpctl list -q --no-legend 2>/dev/null | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $4,$0}')}" )
             if [[ -n "$_dumps" ]]; then
                 _describe -V -t pids 'coredumps' _dumps
             else
index 3a98d01c0e6cde7ace544a4c9e8cef23523aa657..6b74ccdd6092ba710ee4d74fe69ca3b39b627bff 100644 (file)
@@ -4,7 +4,7 @@
 (( $+functions[_loginctl_all_sessions] )) ||
 _loginctl_all_sessions() {
     local session description
-    loginctl --no-legend list-sessions | while read -r session description; do
+    loginctl --no-legend list-sessions 2>/dev/null | while read -r session description; do
         _sys_all_sessions+=( "$session" )
         _sys_all_sessions_descr+=( "${session}:$description" )
     done
@@ -13,7 +13,7 @@ _loginctl_all_sessions() {
 (( $+functions[_loginctl_all_users] )) ||
 _loginctl_all_users() {
     local uid description
-    loginctl --no-legend list-users | while read -r uid description; do
+    loginctl --no-legend list-users 2>/dev/null | while read -r uid description; do
         _sys_all_users+=( "$uid" )
         _sys_all_users_descr+=( "${uid}:$description" )
     done
@@ -22,7 +22,7 @@ _loginctl_all_users() {
 (( $+functions[_loginctl_all_seats] )) ||
 _loginctl_all_seats() {
     local seat description
-    loginctl --no-legend list-seats | while read -r seat description; do
+    loginctl --no-legend list-seats 2>/dev/null | while read -r seat description; do
         _sys_all_seats+=( "$seat" )
         _sys_all_seats_descr+=( "${seat}:$description" )
     done
index 99cc103755eb00bd2d42c80bb0871209fbb57012..d5f7aa9680d6c4b7f011e1ceed316980e06a18ff 100644 (file)
@@ -5,7 +5,7 @@
     __machinectl_get_images () {
         local -a flags
         if [[ $PREFIX == .* ]]; then flags=( --all ); fi
-        machinectl --no-legend list-images $flags | {while read -r a b; do
+        machinectl --no-legend list-images $flags 2>/dev/null | {while read -r a b; do
             # escape : and \; do not interpret existing escape sequences
             printf -- "%s\n" ${a//(#b)(\\|:)/\\$match}
         done;}
index 2917138fff35c2f6acc3cd27330b19bfc52ee564..3d28f1b410e045e5436c38703addd2b8668647ce 100644 (file)
 (( $+functions[_resolvectl_protocols] )) ||
     _resolvectl_protocols() {
         local -a _protocol
-        _protocol=( $(_call_program protocol ${service} --legend=no --protocol help; echo help) )
+        _protocol=( $(_call_program protocol ${service} --legend=no --protocol help 2>/dev/null; echo help) )
         _values 'protocol' "$_protocol[@]"
     }
 
 (( $+functions[_resolvectl_types] )) ||
     _resolvectl_types() {
         local -a _type
-        _type=( $(_call_program type ${service} --legend=no --type help; echo help) )
+        _type=( $(_call_program type ${service} --legend=no --type help 2>/dev/null; echo help) )
         _values 'type' "$_type[@]"
     }
 
 (( $+functions[_resolvectl_classes] )) ||
     _resolvectl_classes() {
         local -a _class
-        _class=( $(_call_program class ${service} --legend=no --class help; echo help) )
+        _class=( $(_call_program class ${service} --legend=no --class help 2>/dev/null; echo help) )
         _values 'class' "$_class[@]"
     }
 
index 39984440ea8a0602f7b9794ea309695f5785d909..dfbc70d138cdd468f79f06b5df01ae4353b63f7b 100644 (file)
@@ -14,7 +14,7 @@
 (( $+functions[_systemd-analyze_critical-chain] )) ||
     _systemd-analyze_critical-chain() {
         local -a _units
-        systemctl list-units --no-legend --no-pager --plain --all |
+        systemctl list-units --no-legend --no-pager --plain --all 2>/dev/null |
         while read -r a b c; do
             _units+=($a)
         done
 (( $+functions[_systemd-analyze_syscall-filter] )) ||
     _systemd-analyze_syscall-filter() {
         local -a _groups
-        _groups=( $(systemd-analyze --quiet --no-pager syscall-filter | grep '^@') )
+        _groups=( $(systemd-analyze --quiet --no-pager syscall-filter 2>/dev/null | grep '^@') )
         _describe -t groups 'syscall groups' _groups || compadd "$@"
     }
 
 (( $+functions[_systemd-analyze_filesystems] )) ||
     _systemd-analyze_filesystems() {
         local -a _groups
-        _groups=( $(systemd-analyze --quiet --no-pager filesystems | grep '^@') )
+        _groups=( $(systemd-analyze --quiet --no-pager filesystems 2>/dev/null | grep '^@') )
         _describe -t groups 'file system groups' _groups || compadd "$@"
     }
 
@@ -50,7 +50,7 @@
 (( $+functions[_systemd-analyze_transient-settings] )) ||
     _systemd-analyze_transient-settings() {
         local -a _types
-        _types=( $(systemctl --no-pager --no-legend -t help) )
+        _types=( $(systemctl --no-pager --no-legend -t help 2>/dev/null) )
         _describe -t types 'unit types' _types
     }