diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 966ab3e894f..1be35793c8c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,7 +9,7 @@ repos: stages: [commit-msg] - repo: https://github.com/scop/pre-commit-shfmt - rev: v3.5.1-1 + rev: v3.6.0-1 hooks: - id: shfmt-docker types: [text] diff --git a/bash_completion b/bash_completion index 283bf4e8171..8ea066f03e3 100644 --- a/bash_completion +++ b/bash_completion @@ -716,7 +716,7 @@ _get_cword() _get_pword() { if ((COMP_CWORD >= 1)); then - _get_cword "${@:-}" 1 + _get_cword "${@-}" 1 fi } @@ -1371,9 +1371,9 @@ _available_interfaces() local PATH=$PATH:/sbin COMPREPLY=($({ - if [[ ${1:-} == -w ]]; then + if [[ ${1-} == -w ]]; then iwconfig - elif [[ ${1:-} == -a ]]; then + elif [[ ${1-} == -a ]]; then ifconfig || ip -c=never link show up || ip link show up else ifconfig -a || ip -c=never link show || ip link show @@ -2226,7 +2226,7 @@ _cd() # Use standard dir completion if no CDPATH or parameter starts with /, # ./ or ../ - if [[ ! ${CDPATH:-} || $cur == ?(.)?(.)/* ]]; then + if [[ ! ${CDPATH-} || $cur == ?(.)?(.)/* ]]; then _filedir -d return fi @@ -2414,7 +2414,7 @@ complete -F _comp_root_command fakeroot gksu gksudo kdesudo really # Return true if the completion should be treated as running as root _complete_as_root() { - [[ $EUID -eq 0 || ${root_command:-} ]] + [[ $EUID -eq 0 || ${root_command-} ]] } _longopt() diff --git a/completions/cvs b/completions/cvs index 0d694efa15f..729e3abdce6 100644 --- a/completions/cvs +++ b/completions/cvs @@ -3,10 +3,10 @@ _cvs_entries() { local prefix=${cur%/*}/ IFS=$'\n' - [[ -e ${prefix:-}CVS/Entries ]] || prefix="" - entries=($(cut -d/ -f2 -s ${prefix:-}CVS/Entries 2>/dev/null)) + [[ -e ${prefix-}CVS/Entries ]] || prefix="" + entries=($(cut -d/ -f2 -s ${prefix-}CVS/Entries 2>/dev/null)) if [[ $entries ]]; then - entries=("${entries[@]/#/${prefix:-}}") + entries=("${entries[@]/#/${prefix-}}") compopt -o filenames fi } diff --git a/completions/hcitool b/completions/hcitool index 8c040c140e0..14729f0a5a8 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -2,7 +2,7 @@ _bluetooth_addresses() { - if [[ ${COMP_BLUETOOTH_SCAN:-} ]]; then + if [[ ${COMP_BLUETOOTH_SCAN-} ]]; then COMPREPLY+=($(compgen -W "$(hcitool scan | awk '/^\t/{print $1}')" -- "$cur")) fi diff --git a/completions/ipmitool b/completions/ipmitool index d31de5e9abd..4844ec7d162 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -86,8 +86,7 @@ _ipmitool() shell) ;; - \ - exec) + exec) _filedir ;; diff --git a/completions/pkgadd b/completions/pkgadd index f92e8a1119a..45bce6ca987 100644 --- a/completions/pkgadd +++ b/completions/pkgadd @@ -44,7 +44,7 @@ _pkgadd() local -a tmplist for filedir in $(/bin/ls -1 $device); do if [[ -d "$device/$filedir" && -f "$device/$filedir/pkginfo" ]]; then - tmplist+=(${tmplist[@]:-} "$filedir") + tmplist+=(${tmplist[@]-} "$filedir") fi done pkginst_list="${tmplist[*]}" diff --git a/completions/smbclient b/completions/smbclient index c72d556bc06..42382e5cd19 100644 --- a/completions/smbclient +++ b/completions/smbclient @@ -7,14 +7,14 @@ _samba_resolve_order() _samba_domains() { - if [[ ${COMP_SAMBA_SCAN:-} ]]; then + if [[ ${COMP_SAMBA_SCAN-} ]]; then COMPREPLY=($(compgen -W '$(smbtree -N -D)' -- "$cur")) fi } _samba_hosts() { - if [[ ${COMP_SAMBA_SCAN:-} ]]; then + if [[ ${COMP_SAMBA_SCAN-} ]]; then COMPREPLY=($(compgen -W "$( smbtree -N -S | command sed -ne 's/^[[:space:]]*\\\\*\([^[:space:]]*\).*/\1/p'