summaryrefslogtreecommitdiff
path: root/modules/common/common/shell/functions.bash
diff options
context:
space:
mode:
Diffstat (limited to 'modules/common/common/shell/functions.bash')
-rw-r--r--modules/common/common/shell/functions.bash18
1 files changed, 2 insertions, 16 deletions
diff --git a/modules/common/common/shell/functions.bash b/modules/common/common/shell/functions.bash
index c18104f..d947d0f 100644
--- a/modules/common/common/shell/functions.bash
+++ b/modules/common/common/shell/functions.bash
@@ -1,30 +1,16 @@
-_complete_alias() {
- local alias_name=$1
- local base_function=$2
- local function_name=_alias_$alias_name
- shift 2
- eval "$function_name() {
- COMP_WORDS=( ${*@Q} \"\${COMP_WORDS[@]:1}\" )
- (( COMP_CWORD += $# - 1 ))
- _completion_loader $1
- $base_function
- }"
- complete -F "$function_name" "$alias_name"
-}
-
function where() {
local s
s="$(type -P "$1")"
realpath "$s"
}
-_complete_alias where _complete complete
+complete -F _command where
function what() {
local s
s="$(where "$1")"
printf "%s\n" "${s%/*/*}"
}
-_complete_alias what _complete complete
+complete -F _command what
function cat() {
if (($# == 1)) && [[ -d $1 ]]; then