Add smug.bash autocomplete script
This commit is contained in:
commit
e6e0cb4443
15
completions/smug.bash
Normal file
15
completions/smug.bash
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
_smug() {
|
||||
local cur
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
|
||||
if [[ $COMP_CWORD -ge 2 ]]; then
|
||||
COMPREPLY=()
|
||||
return 0
|
||||
fi
|
||||
# List files in $HOME/.config/smug/ with .yml extension, removing the extension
|
||||
COMPREPLY=($(compgen -W "$(find "$HOME/.config/smug/" -maxdepth 1 -name '*.yml' -exec basename {} .yml \;)" -- "$cur"))
|
||||
}
|
||||
|
||||
complete -F _smug smug
|
Loading…
Reference in New Issue
Block a user