Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup even more plugins #2282

Merged
merged 20 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ repos:
hooks:
- id: git-check # Configure in .gitattributes
- id: shellcheck
files: "\\.(bash)$"
- id: shfmt
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.7
Expand All @@ -38,7 +39,7 @@ repos:
name: Check .bash files against bash-it requirements
entry: ./hooks/dot-bash.sh
language: system
files: "\\.(bash|bats)$"
files: "\\.(bash)$"
types: [file]
- id: clean-files-txt
name: Check that clean_files.txt is sorted alphabetically.
Expand Down
22 changes: 11 additions & 11 deletions completion/available/sqlmap.completion.bash
seefood marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function _sqlmap() {

# List directory content
--tamper)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W "${tamper:-}" -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W "${tamper:-}" -- "$cur")"
seefood marked this conversation as resolved.
Show resolved Hide resolved
return 0
;;
--output-dir | -t | -l | -m | -r | --load-cookies | --proxy-file | --sql-file | --shared-lib | --file-write)
Expand All @@ -32,43 +32,43 @@ function _sqlmap() {
return 0
;;
--method)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'GET POST PUT' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'GET POST PUT' -- "$cur")"
return 0
;;
--auth-type)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'Basic Digest NTLM PKI' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'Basic Digest NTLM PKI' -- "$cur")"
return 0
;;
--tor-type)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'HTTP SOCKS4 SOCKS5' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'HTTP SOCKS4 SOCKS5' -- "$cur")"
return 0
;;
-v)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W '1 2 3 4 5 6' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W '1 2 3 4 5 6' -- "$cur")"
return 0
;;
--dbms)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'mysql mssql access postgres' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'mysql mssql access postgres' -- "$cur")"
return 0
;;
--level | --crawl)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W '1 2 3 4 5' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W '1 2 3 4 5' -- "$cur")"
return 0
;;
--risk)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W '0 1 2 3' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W '0 1 2 3' -- "$cur")"
return 0
;;
--technique)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'B E U S T Q' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'B E U S T Q' -- "$cur")"
return 0
;;
-s)
_filedir sqlite
return 0
;;
--dump-format)
IFS=' ' read -r -a COMPREPLY <<< "$(compgen -W 'CSV HTML SQLITE' -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W 'CSV HTML SQLITE' -- "$cur")"
return 0
;;
-x)
Expand All @@ -78,7 +78,7 @@ function _sqlmap() {
esac

if [[ "$cur" == * ]]; then
IFS=' ' read -r -a COMPREPLY <<< "$(
mapfile -t COMPREPLY <<< "$(
compgen -W '-h --help -hh --version -v -d -u --url -l -x -m -r -g -c --method \
--data --param-del --cookie --cookie-del --load-cookies \
--drop-set-cookie --user-agent --random-agent --host --referer \
Expand Down
4 changes: 2 additions & 2 deletions plugins/available/fzf.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ fe() {

local IFS=$'\n'
local files
IFS=" " read -r -a files --query="$1" --multi --select-1 --exit-0 <<< fzf-tmux
[[ -n "$files" ]] && ${EDITOR:-vim} "${files[@]}"
mapfile -t files <<< "$(fzf-tmux --query="$1" --multi --select-1 --exit-0)"
[[ -n "${files[0]}" ]] && "${EDITOR:-vim}" "${files[@]}"
seefood marked this conversation as resolved.
Show resolved Hide resolved
}

fcd() {
Expand Down
10 changes: 5 additions & 5 deletions plugins/available/pack.plugin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ __pack_handle_reply() {
else
allflags=("${flags[*]} ${two_word_flags[*]}")
fi
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${allflags[*]}" -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W "${allflags[*]}" -- "$cur")"
if [[ $(type -t compopt) = "builtin" ]]; then
[[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
fi
Expand Down Expand Up @@ -100,10 +100,10 @@ __pack_handle_reply() {
if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
completions+=("${must_have_one_flag[@]}")
fi
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${completions[*]}" -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W "${completions[*]}" -- "$cur")"

if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
IFS=" " read -r -a COMPREPLY <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")"
mapfile -t COMPREPLY <<< "$(compgen -W "${noun_aliases[*]}" -- "$cur")"
fi

if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
Expand All @@ -130,7 +130,7 @@ __pack_handle_filename_extension_flag() {

__pack_handle_subdirs_in_dir_flag() {
local dir="$1"
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd || return 1 > /dev/null 2>&1
pushd "${dir}" > /dev/null 2>&1 && _filedir -d && popd > /dev/null 2>&1 || return 1
}

__pack_handle_flag() {
Expand Down Expand Up @@ -568,8 +568,8 @@ _pack_root_command() {

__start_pack() {
local cur prev words cword
#shellcheck disable=SC2034
declare -A flaghash 2> /dev/null || :
export flaghash
declare -A aliashash 2> /dev/null || :
if declare -F _init_completion > /dev/null 2>&1; then
_init_completion -s || return
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading