Add bash file completion for hurl/hurlfmt
This commit is contained in:
parent
152460428d
commit
dece792fb3
|
|
@ -29,7 +29,8 @@ _"""
|
|||
+ """' -- "$cur"))
|
||||
return
|
||||
fi
|
||||
|
||||
# Generate filenames by default
|
||||
COMPREPLY=($(compgen -f "$cur" | sort))
|
||||
} &&
|
||||
complete -F _"""
|
||||
+ name
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ _hurl()
|
|||
COMPREPLY=($(compgen -W '--aws-sigv4 --cacert --cert --key --color --compressed --connect-timeout --connect-to --continue-on-error --cookie --cookie-jar --curl --delay --error-format --file-root --location --location-trusted --from-entry --glob --header --http1.0 --http1.1 --http2 --http3 --ignore-asserts --include --insecure --interactive --ipv4 --ipv6 --jobs --json --limit-rate --max-filesize --max-redirs --max-time --netrc --netrc-file --netrc-optional --no-color --no-output --noproxy --output --parallel --path-as-is --proxy --repeat --report-html --report-json --report-junit --report-tap --resolve --retry --retry-interval --secret --ssl-no-revoke --test --to-entry --unix-socket --user --user-agent --variable --variables-file --verbose --very-verbose --help --version' -- "$cur"))
|
||||
return
|
||||
fi
|
||||
|
||||
# Generate filenames by default
|
||||
COMPREPLY=($(compgen -f "$cur" | sort))
|
||||
} &&
|
||||
complete -F _hurl hurl
|
||||
# ex: filetype=sh
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ _hurlfmt()
|
|||
COMPREPLY=($(compgen -W '--check --color --in-place --in --no-color --output --out --standalone --help --version' -- "$cur"))
|
||||
return
|
||||
fi
|
||||
|
||||
# Generate filenames by default
|
||||
COMPREPLY=($(compgen -f "$cur" | sort))
|
||||
} &&
|
||||
complete -F _hurlfmt hurlfmt
|
||||
# ex: filetype=sh
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
--verbose --very-verbose --version
|
||||
--verbose
|
||||
tests_ok/completion_bash.out tests_ok/completion_bash.ps1 tests_ok/completion_bash.sh
|
||||
|
|
|
|||
|
|
@ -4,12 +4,14 @@ set -Eeuo pipefail
|
|||
# shellcheck source=/dev/null
|
||||
source ../../completions/hurl.bash
|
||||
|
||||
export COMP_WORDS=(curl --ver)
|
||||
export COMP_CWORD=1
|
||||
test () {
|
||||
unset COMPREPLY
|
||||
export COMP_WORDS=( hurl "$@" )
|
||||
export COMP_CWORD=$(( ${#COMP_WORDS[@]} -1 )) # last parameter
|
||||
_hurl
|
||||
echo "${COMPREPLY[*]}"
|
||||
}
|
||||
|
||||
export COMP_WORDS=(curl --verb)
|
||||
export COMP_CWORD=1
|
||||
_hurl
|
||||
echo "${COMPREPLY[*]}"
|
||||
test --ver
|
||||
test --verb
|
||||
test --verbose tests_ok/completion_b
|
||||
|
|
|
|||
Loading…
Reference in New Issue