diff options
author | wickles <4229542+wickles@users.noreply.github.com> | 2023-07-14 10:32:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-14 18:32:21 +0100 |
commit | 0038cb24b4adbb85321e3c36fb7079fc898de44e (patch) | |
tree | 6bcbddf40796df19b38c380a50d374cb82137239 | |
parent | 658f8d2e2b3ddbf256e1830fc01ad8b029ce010c (diff) |
Fix filename completions for zsh and bash (#331)
-rw-r--r-- | completions/_dust | 2 | ||||
-rw-r--r-- | completions/dust.bash | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/completions/_dust b/completions/_dust index 9e8be82..5443a41 100644 --- a/completions/_dust +++ b/completions/_dust @@ -64,7 +64,7 @@ _dust() { '(-F --only-file -t --file_types)--only-dir[Only directories will be displayed.]' \ '(-D --only-dir)-F[Only files will be displayed. (Finds your largest files)]' \ '(-D --only-dir)--only-file[Only files will be displayed. (Finds your largest files)]' \ -'*::inputs:' \ +'*:inputs:_files' \ && ret=0 } diff --git a/completions/dust.bash b/completions/dust.bash index 83d7b65..e34777a 100644 --- a/completions/dust.bash +++ b/completions/dust.bash @@ -20,9 +20,12 @@ _dust() { case "${cmd}" in dust) opts="-h -V -d -n -p -X -L -x -s -r -c -b -z -R -f -i -v -e -t -w -H -P -D -F --help --version --depth --number-of-lines --full-paths --ignore-directory --dereference-links --limit-filesystem --apparent-size --reverse --no-colors --no-percent-bars --min-size --screen-reader --skip-total --filecount --ignore_hidden --invert-filter --filter --file_types --terminal_width --si --no-progress --only-dir --only-file <inputs>..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then + if [[ ${cur} == -* ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 + elif [[ ${cur} == * ]] ; then + _filedir + return 0 fi case "${prev}" in --depth) |