pull/1962/merge
John D Pell 2023-07-22 14:31:54 +08:00 committed by GitHub
commit 84c9b07e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 148 additions and 152 deletions

View File

@ -7,11 +7,9 @@
# | # |
# ---------------------------------------------------------------------------+ # ---------------------------------------------------------------------------+
if _command_exists sqlmap _command_exists sqlmap || return
then
function _sqlmap() function _sqlmap() {
{
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
@ -143,10 +141,10 @@ then
--dependencies --disable-coloring --identify-waf \ --dependencies --disable-coloring --identify-waf \
--mobile --page-rank --purge-output --smart \ --mobile --page-rank --purge-output --smart \
--sqlmap-shell --wizard ' --sqlmap-shell --wizard '
COMPREPLY=( $( \ COMPREPLY=($(
(while read -d ' ' i; do (
[[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] && while read -d ' ' i; do
continue [[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] && continue
# flatten array with spaces on either side, # flatten array with spaces on either side,
# otherwise we cannot grep on word boundaries of # otherwise we cannot grep on word boundaries of
# first and last word # first and last word
@ -154,7 +152,8 @@ then
# remove word from list of completions # remove word from list of completions
COMPREPLY=(${COMPREPLY/ ${i%% *} / }) COMPREPLY=(${COMPREPLY/ ${i%% *} / })
done done
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}" printf '%s ' "${COMPREPLY[@]}"
) <<< "${COMP_WORDS[@]}"
)) ))
#else #else
@ -162,7 +161,4 @@ then
fi fi
} }
complete -F _sqlmap sqlmap complete -F _sqlmap sqlmap
fi