Commit a56e8c81 authored by Eugene Stulin's avatar Eugene Stulin

Autocompletion for special categories corrected. Closed #7

parent 9712d617
......@@ -3,7 +3,9 @@ source build-scripts/env.sh
SRCDIR=source/
SRC="${SRCDIR}/*.d"
DEB_HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`
if [[ -e /usr/bin/dpkg-architecture ]]; then
DEB_HOST_MULTIARCH=`dpkg-architecture -qDEB_HOST_MULTIARCH`
fi
BINVERSION=$1 # release or debug
DC=$2 # dmd, ldc2
......
#!/bin/bash
APP=vitis
readonly VERSION=`cat source/version`
ARCH=`dpkg --print-architecture`
if [[ -e /usr/bin/dpkg ]]; then
ARCH=`dpkg --print-architecture`
fi
readonly BINPATH_BASEDIR=build/bin
BINPATH="${BINPATH_BASEDIR}/${APP}"
......@@ -28,4 +31,4 @@ readonly RL_BASHCOMP=${RL_SHAREDIR}/bash-completion/completions
#readonly RPMDIST=${RPMDIST_RAW:1} # not used
readonly BS=build-scripts
readonly RESOURCES_DIR=resources
\ No newline at end of file
readonly RESOURCES_DIR=resources
......@@ -6,7 +6,7 @@ completeSpecificPath() {
# declare variables
local curr prev words cword split
local _item _COMPREPLY
local method=$1 # WithDirs or WithFiles or "" (nothing)
local method=$1 # WithDirs or WithFiles or "" (nothing)
#go the specific directory
pushd "${2}" &>/dev/null || return 1
......@@ -36,6 +36,17 @@ completeSpecificPath() {
tempArray[$i]=${COMPREPLY[$i]}
done
if [[ $method == WithDirs ]]; then
for _item in ${rootAutoDirs[@]}; do
pushd "${2}/${_item}" &>/dev/null || continue
_init_completion -s
_filedir
length=${#COMPREPLY[@]}
_COMPREPLY+=${COMPREPLY[0]}
popd &>/dev/null
done
fi
# iterate on original replies
for _item in "${tempArray[@]}"; do
if [[ $method == WithDirs && -d "${_item}" ]]; then
......@@ -108,7 +119,6 @@ _vitis()
filespaces=$(echo $str_filespaces | tr ";" "\n")
fi
COMPREPLY=()
curr="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment