Files
vmimages/dotfiles/sstent/.bash_completion
2024-01-22 18:05:00 +00:00

25 lines
779 B
Bash

# bash completion for bob -*- shell-script -*-
_nomad()
{
local cur prev words cword curdir
_init_completion || return
suffix=".nomad"
case $prev in
nomad_run|nomad_stop|nomad_exec_bash|nomad_exec_sh|nomad_purge)
curdir=$(pwd)
cd ~/projects/nomad/nomad_jobs/enabled/ 2>/dev/null && _filedir
for ((i=0; i<${#COMPREPLY[@]}; i++)); do
# COMPREPLY[$i]="${COMPREPLY[$i]/-module/module}"
COMPREPLY[$i]="${COMPREPLY[$i]%"$suffix"}"
done
cd "$curdir"
;;
esac
} &&
complete -F _nomad nomad_run
complete -F _nomad nomad_stop
complete -F _nomad nomad_exec_bash
complete -F _nomad nomad_exec_sh
complete -F _nomad nomad_purge