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 )
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
}
__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() {
if __contains_word "$prev" ${OPTS[ARG]}; then
case $prev in
--json)
- comps=$(networkctl --json=help)
+ comps=$(networkctl --json=help 2>/dev/null)
;;
*)
return 0
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"
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() {
}
__systemd_properties() {
- {{LIBEXECDIR}}/systemd --dump-bus-properties
+ {{LIBEXECDIR}}/systemd --dump-bus-properties 2>/dev/null
}
__contains_word () {
}
__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
}
__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() {
}
__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
__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() {
}
__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() {
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"
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 () {
}
__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
}
__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 () {
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
(( $+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
(( $+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
(( $+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
__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;}
(( $+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[@]"
}
(( $+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 "$@"
}
(( $+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
}