Skip to content

Commit

Permalink
feat(_comp_compgen_known_hosts): return 2 on usage error
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Sep 17, 2023
1 parent da26178 commit 43bb8f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -2476,7 +2476,7 @@ _comp_compgen_known_hosts__impl()
F)
if [[ ! $OPTARG ]]; then
echo "bash_completion: $FUNCNAME: -F: an empty filename is specified" >&2
return 1
return 2
fi
configfile=$OPTARG
;;
Expand All @@ -2485,13 +2485,13 @@ _comp_compgen_known_hosts__impl()
6) ipv6=set ;;
*)
echo "bash_completion: $FUNCNAME: usage error" >&2
return 1
return 2
;;
esac
done
if (($# < OPTIND)); then
echo "bash_completion: $FUNCNAME: missing mandatory argument CWORD" >&2
return 1
return 2
fi
cur=${!OPTIND}
((OPTIND += 1))
Expand All @@ -2501,7 +2501,7 @@ _comp_compgen_known_hosts__impl()
printf '%s ' ${!OPTIND}
shift
done)" >&2
return 1
return 2
fi

[[ $cur == *@* ]] && prefix=$prefix${cur%@*}@ && cur=${cur#*@}
Expand Down

0 comments on commit 43bb8f0

Please sign in to comment.