summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorSimon Rettberg2020-08-07 10:56:23 +0200
committerSimon Rettberg2020-08-07 10:56:23 +0200
commit6222348e66a8e86425918ffae30fb8cfe0643404 (patch)
tree50260aa0dae4c6c3d5ec3f1c22fa5737da217cfe /data
parent[beamergui] Increase delay before auto-center (diff)
downloadmltk-6222348e66a8e86425918ffae30fb8cfe0643404.tar.gz
mltk-6222348e66a8e86425918ffae30fb8cfe0643404.tar.xz
mltk-6222348e66a8e86425918ffae30fb8cfe0643404.zip
Move bash completion script
Diffstat (limited to 'data')
-rw-r--r--data/mltk.bash_completion34
1 files changed, 0 insertions, 34 deletions
diff --git a/data/mltk.bash_completion b/data/mltk.bash_completion
deleted file mode 100644
index 32effea9..00000000
--- a/data/mltk.bash_completion
+++ /dev/null
@@ -1,34 +0,0 @@
-pls() {
- ls --color=never "$1"
-}
-_mltk_module() {
- local path="$(readlink -f ${COMP_WORDS[0]})"
- local cur="${COMP_WORDS[COMP_CWORD]}"
- local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
- # if '-n' present, stop here
- if grep -qE '\s+-n\s?' <<< "$COMP_LINE" ; then
- return
- fi
-
- # if 2 words, needs to be a target
- if [ "${#COMP_WORDS[@]}" -eq 2 ]; then
- COMPREPLY=($(compgen -W "$(pls $(dirname $path)/core/targets) -n" -- "$cur"))
- return
- fi
-
- # actions now:
- local defaults="-b -c"
- # only add '-d' if not present already
- if ! grep -qE '\s+-d\s+' <<< "$COMP_LINE" ; then
- defaults="$defaults -d"
- fi
- COMPREPLY=($(compgen -W "$defaults" -- "$cur"))
-
- # now it can be either actions or modules for the targets
- COMPREPLY+=($(compgen -W "$(pls $(dirname $path)/core/targets/${COMP_WORDS[1]})" -- "$cur"))
- return
-}
-
-complete -F _mltk_module ./mltk
-