zsh-completion: remove non-portable uses of \s in awk (#3063)
This commit is contained in:
parent
c54318c66f
commit
673fca32be
|
@ -16,7 +16,7 @@ _coredumpctl_command(){
|
||||||
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
|
cmd="${${_coredumpctl_cmds[(r)$words[1]:*]%%:*}}"
|
||||||
if (( $#cmd )); then
|
if (( $#cmd )); then
|
||||||
# user can set zstyle ':completion:*:*:coredumpctl:*' sort no for coredumps to be ordered by date, otherwise they get ordered by pid
|
# user can set zstyle ':completion:*:*:coredumpctl:*' sort no for coredumps to be ordered by date, otherwise they get ordered by pid
|
||||||
_dumps=( "${(foa)$(coredumpctl list | awk 'BEGIN{OFS=":"} /^\s/ {sub(/[[ \t]+/, ""); print $5,$0}' 2>/dev/null)}" )
|
_dumps=( "${(foa)$(coredumpctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $5,$0}' 2>/dev/null)}" )
|
||||||
if [[ -n "$_dumps" ]]; then
|
if [[ -n "$_dumps" ]]; then
|
||||||
_describe -t pids 'coredumps' _dumps
|
_describe -t pids 'coredumps' _dumps
|
||||||
else
|
else
|
||||||
|
|
|
@ -14,7 +14,7 @@ _networkctl_command(){
|
||||||
local -a _links
|
local -a _links
|
||||||
cmd="${${_networkctl_cmds[(r)$words[1]:*]%%:*}}"
|
cmd="${${_networkctl_cmds[(r)$words[1]:*]%%:*}}"
|
||||||
if [ $cmd = "status" ]; then
|
if [ $cmd = "status" ]; then
|
||||||
_links=( "${(foa)$(networkctl list --no-legend | awk 'BEGIN{OFS=":"} /^\s/ {sub(/[[ \t]+/, ""); print $2,$0}' 2>/dev/null)}" )
|
_links=( "${(foa)$(networkctl list --no-legend | awk 'BEGIN{OFS=":"} {sub(/[[ \t]+/, ""); print $2,$0}' 2>/dev/null)}" )
|
||||||
if [[ -n "$_links" ]]; then
|
if [[ -n "$_links" ]]; then
|
||||||
_describe -t links 'links' _links
|
_describe -t links 'links' _links
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue