Skip to content

Commit 9ec2e9e

Browse files
committed
style(_comp_awk): prefer awk -F <char> to awk -F<char>
We have been using the connected form of the `-F` option to the `awk` command because Solaris awk does not support the separate form of the option argument `-F <char>`. Nevertheless, there are some cases of the separate form in the codespace, though the majority is in the connected form. Since we now switch to `_comp_awk` for POSIX awk, we unify them to the separate form `-F <char>`.
1 parent adc34df commit 9ec2e9e

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

bash_completion

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ _comp_compgen_terms()
23292329
_comp_expand_glob dirs '/{etc,lib,usr/lib,usr/share}/terminfo/?'
23302330
((${#dirs[@]})) &&
23312331
find "${dirs[@]}" -type f -maxdepth 1 |
2332-
_comp_awk -F/ '{ print $NF }'
2332+
_comp_awk -F / '{ print $NF }'
23332333
} 2>/dev/null)"
23342334
}
23352335

@@ -2628,7 +2628,7 @@ _comp_compgen_known_hosts__impl()
26282628
type avahi-browse &>/dev/null; then
26292629
# Some old versions of avahi-browse reportedly didn't have -k
26302630
# (even if mentioned in the manpage); those we do not support any more.
2631-
local generated=$(avahi-browse -cprak 2>/dev/null | _comp_awk -F';' \
2631+
local generated=$(avahi-browse -cprak 2>/dev/null | _comp_awk -F ';' \
26322632
'/^=/ && $5 ~ /^_(ssh|workstation)\._tcp$/ { print $7 }' |
26332633
sort -u)
26342634
_comp_compgen -av known_hosts -- -P "$prefix" -S "$suffix" -W '$generated'

completions/_rfkill

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ _comp_cmd_rfkill()
1717
;;
1818
2)
1919
if [[ $prev == block || $prev == unblock ]]; then
20-
_comp_compgen_split -- "$("$1" list |
21-
_comp_awk -F: '/^[0-9]/ {print $1}') all wifi bluetooth uwb
22-
wimax wwan gps"
20+
_comp_compgen_split -- "
21+
$("$1" list | _comp_awk -F : '/^[0-9]/ {print $1}')
22+
all wifi bluetooth uwb wimax wwan gps"
2323
fi
2424
;;
2525
esac

completions/firefox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ _comp_cmd_firefox()
1515
;;
1616
-P)
1717
_comp_compgen_split -- "$(
18-
_comp_awk -F= '$1 == "Name" { print $2 }' \
18+
_comp_awk -F = '$1 == "Name" { print $2 }' \
1919
~/.mozilla/firefox/profiles.ini 2>/dev/null
2020
)"
2121
return

completions/gphoto2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ _comp_cmd_gphoto2()
3030
;;
3131
--camera)
3232
_comp_compgen_split -l -- "$("$1" --list-cameras 2>/dev/null |
33-
_comp_awk -F'"' 'NR>2 { print $2 }')"
33+
_comp_awk -F '"' 'NR>2 { print $2 }')"
3434
return
3535
;;
3636
--get-config | --set-config | --set-config-index | --set-config-value)

completions/ktutil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _comp_cmd_ktutil__heimdal_principals()
99
_comp_cmd_ktutil__heimdal_realms()
1010
{
1111
_comp_compgen_split -- "$(kadmin -l dump 2>/dev/null |
12-
_comp_awk '{print $1}' | _comp_awk -F@ '{print $2}')"
12+
_comp_awk '{print $1}' | _comp_awk -F @ '{print $2}')"
1313
}
1414

1515
_comp_cmd_ktutil__heimdal_encodings()

completions/lilo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
_comp_cmd_lilo__labels()
44
{
5-
_comp_compgen_split -- "$(_comp_awk -F= '$1 ~ /^[ \t]*label$/ {print $2}' \
5+
_comp_compgen_split -- "$(_comp_awk -F = '$1 ~ /^[ \t]*label$/ {print $2}' \
66
"${1:-/etc/lilo.conf}" 2>/dev/null | command sed -e 's/\"//g')"
77
}
88

completions/modprobe

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ _comp_cmd_modprobe()
9898
else
9999
_comp_compgen_split -S = -- "$(PATH="$PATH:/sbin" \
100100
modinfo -p "$module" 2>/dev/null |
101-
_comp_awk -F: '!/^[ \t]/ { print $1 }')"
101+
_comp_awk -F : '!/^[ \t]/ { print $1 }')"
102102
[[ ${COMPREPLY-} == *= ]] && compopt -o nospace
103103
fi
104104
else

completions/pkg-get

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ _comp_cmd_pkg_get__catalog_file()
1616
conffile="${conffile:-/opt/csw/etc/pkg-get.conf}"
1717

1818
if [[ ! $url ]]; then
19-
url=$(_comp_awk -F= ' $1=="url" { print $2 }' "$conffile")
19+
url=$(_comp_awk -F = ' $1=="url" { print $2 }' "$conffile")
2020
fi
2121

2222
ret="${url##*//}"

completions/pkgutil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ _comp_cmd_pkgutil()
7373
if [[ $command && $cur != -* ]]; then
7474

7575
local mirrors mirror_url
76-
mirrors=$(_comp_awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' "${configuration_files[@]}")
76+
mirrors=$(_comp_awk -F = ' $1 ~ /^ *mirror *$/ { print $2 }' "${configuration_files[@]}")
7777
mirrors=${mirrors:-http://mirror.opencsw.org/opencsw/testing}
7878
for mirror_url in $mirrors; do
7979
_comp_cmd_pkgutil__url2catalog "$mirror_url"

completions/tipc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _comp_cmd_tipc__bearer()
4343
case "$media" in
4444
"udp")
4545
local names=$(
46-
tipc bearer list 2>/dev/null | _comp_awk -F: '/^udp:/ {print $2}'
46+
tipc bearer list 2>/dev/null | _comp_awk -F : '/^udp:/ {print $2}'
4747
)
4848
_comp_compgen -- -W '$names'
4949
;;

0 commit comments

Comments
 (0)