Provide bash-completion an aliases for availale sequences including installation script

This commit is contained in:
2021-04-15 14:54:29 +02:00
parent 2872901924
commit 37069952d4
4 changed files with 139 additions and 19 deletions

20
installCompletion.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
sequencerCompletion() {
local SEQBASE="/opt/sequencer"
local SEQCOMP_LOC="$SEQBASE/sqnall-completion.bash"
local SEQCOMP_LOADER="$(realpath ~/.bashrc)"
local SEQCOMP_SOURCE="source \"$SEQCOMP_LOC\""
grep "$SEQCOMP_SOURCE" "$SEQCOMP_LOADER" >>/dev/null 2>&1
if [ $? -eq 0 ]; then
echo " [I] Completion already installed ($SEQCOMP_LOADER)"
else
echo "$SEQCOMP_SOURCE" >>"$SEQCOMP_LOADER"
[ $? -eq 0 ] && echo " [I] Sequence bash-completion installed"
fi
source "$SEQCOMP_LOC"
}
sequencerCompletion