completion

This commit is contained in:
Flo 2024-12-21 15:49:15 +01:00
parent 40f8ea1541
commit 5f8e60e03a
2 changed files with 30 additions and 2 deletions

View File

@ -61,3 +61,17 @@ dcom() {
unset $(grep -v '^#' "$SYSTEM_ENV_FILE" | sed -E 's/(.*)=.*/\1/' | xargs) unset $(grep -v '^#' "$SYSTEM_ENV_FILE" | sed -E 's/(.*)=.*/\1/' | xargs)
fi fi
} }
_dcom_completion() {
local SYSTEMS_CONFIG="$ENV_DIR/.systems"
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(awk '{print $1}' $SYSTEMS_CONFIG | paste -sd' ' -)"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _dcom_completion dcom

View File

@ -74,3 +74,17 @@ drun() {
fi fi
fi fi
} }
_drun_completion() {
local SYSTEMS_CONFIG="$ENV_DIR/.systems"
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(awk '{print $1}' $SYSTEMS_CONFIG | paste -sd' ' -)"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F _drun_completion drun