Completion script now reverts to completing filepaths if word starts with ./ or /

This commit is contained in:
Jesse Gardner 2021-03-30 17:36:48 -07:00
parent 06521942cc
commit 2406cdeed3
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ THIS_ARG="${COMP_WORDS[$COMP_CWORD]}"
set_coms="connect|destroy|exec|resume|rm|rm\-shred|rm\-wipe|save|save\-rm|"
set_coms="${set_coms}start|suspend|restore"
[[ "$THIS_ARG" =~ ^('./'|'/') ]] &&
{ read -ra COMPREPLY < <(compgen -f "$THIS_ARG" | tr "\n" " " ); return 0; }
declare -a suggestions
if [[ "$THIS_ARG" =~ ^\-\- ]]; then