Skip to content

Commit 5580a6e

Browse files
akinomyogascop
authored andcommitted
refactor(_known_hosts_real,tar,upgradepkg): use "set" as positive flag
1 parent 78e4e4a commit 5580a6e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

bash_completion

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ _known_hosts_real()
19591959
local OPTIND=1
19601960
while getopts "ac46F:p:" flag "$@"; do
19611961
case $flag in
1962-
a) aliases='yes' ;;
1962+
a) aliases=set ;;
19631963
c) suffix=':' ;;
19641964
F)
19651965
if [[ ! $OPTARG ]]; then
@@ -1969,8 +1969,8 @@ _known_hosts_real()
19691969
configfile=$OPTARG
19701970
;;
19711971
p) prefix=$OPTARG ;;
1972-
4) ipv4=1 ;;
1973-
6) ipv6=1 ;;
1972+
4) ipv4=set ;;
1973+
6) ipv6=set ;;
19741974
*)
19751975
echo "bash_completion: $FUNCNAME: usage error" >&2
19761976
return 1

completions/tar

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ __tar_posix_prev_handle()
675675

676676
_posix_tar()
677677
{
678-
local long_opts short_opts basic_tar="" \
678+
local long_opts short_opts basic_tar=set \
679679
long_arg_none="" long_arg_opt long_arg_req="" \
680680
short_arg_none short_arg_opt short_arg_req \
681681
tar_mode tar_mode_arg old_opt_progress=0 \
@@ -691,7 +691,6 @@ _posix_tar()
691691

692692
_comp_initialize -s -- "$@" || return
693693

694-
basic_tar=yes
695694
tar_mode=none
696695

697696
# relatively compatible modes are {c,t,x}

completions/upgradepkg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _upgradepkg()
1717
local nofiles="" IFS=$'\n'
1818
compopt -o filenames
1919
COMPREPLY=($(compgen -P "$prev%" -f -X "!*.@(t[bgxl]z)" -- "$cur"))
20-
[[ ${COMPREPLY-} ]] || nofiles=1
20+
[[ ${COMPREPLY-} ]] || nofiles=set
2121
COMPREPLY+=($(compgen -P "$prev%" -S '/' -d -- "$cur"))
2222
[[ $nofiles ]] && compopt -o nospace
2323
return

0 commit comments

Comments
 (0)