bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash completion


From: jonathan MERCIER
Subject: bash completion
Date: Sun, 07 Aug 2011 17:35:04 +0200

I have a bash completion file (see below)
It works fine, but i would like add a feature => not expand the flag by
a space when it contain '='
curently when i do:
$ ldc2 -Df<tab>
ldc2 -Df=⊔
i would like:
 ldc2 -Df<tab>
ldc2 -Df=

without space

tanks a lot
-------------------
# bash completion for ldc
_ldc()
{
    local cur prev opts opts_with_path
    COMPREPLY=()
    cur="${COMP_WORDS[COMP_CWORD]}"
    prev="${COMP_WORDS[COMP_CWORD-1]}"
    opts_with_path="-Dd= -Df= -Hd= -Hf= -I= -Xf= od= -of=
-profile-info-file= "
    opts="  -D -Dd= -Df= -H -Hd= -Hf= -I= -J= -L= -O -O0 -O1 -O2 -O3 -O4
-O5 -X -Xf= -annotate -asm-verbose -c \
            -check-printf-calls -code-model =medium -d
-d-debug=<level/idents> -d-version -debuglib -defaultlib \
            -deps -enable-asserts -enable-boundscheck -disable-d-passes
-disable-excess-fp-precision -disable-fp-elim \
            -disable-gc2stack -disable-non-leaf-fp-elim
-enable-preconditions -disable-red-zone \
            -disable-simplify-drtcalls -disable-spill-fusing
-enable-contracts -enable-correct-eh-support \
            -enable-fp-mad -enable-inlining -enable-invariants
-enable-load-pre -enable-no-infs-fp-math \
            -enable-no-nans-fp-math -enable-postconditions -ena
-enable-unsafe-fp-math -fdata-sections \
            -ffunction-sections -float-abi Generating debug information:
-g -gc -help -ignore \
            -internalize-public-api-file= -internalize-public-api-list=
-jit-emit-debug -jit-enable-eh \
            -join-liveintervals -limit-float-precis -linkonce-templates
-m32 -m64 -march= -mattr= -mcpu= -mtriple= \
            -nested-ctx -noasm -noruntime - -nozero-initialized-in-bss
-o- -od= -of= -op -oq -output-bc -output-o \
            -output- -pre-RA-sched  -print-after -print-after-all
-print-before -print-before-all -print-machineinstrs \
            -profile-estimator-loop-weight= -profile-info-file=
-profile-verifier-noassert \
            -regalloc -rel =dynamic-no-pic -rewriter -run= -shrink-wrap
-singleobj -soft-float -spiller -st \
            -stack-protector-buffer-size= -stats -tailcallopt
-time-passes -unittest -unwind-tables -v \
            "
    if [[ ${opts_with_path} =~ ${prev} ]] ; then
        COMPREPLY=( $(compgen -f ${cur}) )
        return 0
    elif [[ ${cur} == -* ]] ; then
        COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
        return 0
    fi
}
complete -F _ldc ldc2


-----------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]