File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,16 +42,15 @@ function _oscap {
4242 opts[oscap:info]="--fetch-remote-resources --local-files --profile --profiles --references"
4343
4444 # local variables
45- local std cmd i prev
46- local c=1
47- local cur="`_get_cword`"
48- local prog="${COMP_WORDS[0]}"
45+ local cur prev words cword split
46+ _init_completion -s || return
47+ local cmd i
48+ local c=1
4949 local modpath='oscap'
50- _comp__split_longopt || prev="${COMP_WORDS[$COMP_CWORD-1]}"
5150
5251 # get module path
53- while [ $c -lt $COMP_CWORD ]; do
54- i="${COMP_WORDS [c]}"
52+ while [ $c -lt $cword ]; do
53+ i="${words [c]}"
5554 case "$i" in
5655 # TODO handle generic switches
5756 -*) _oscap_noarg "$i"; c=$((c + $?)) ;;
@@ -70,7 +69,12 @@ function _oscap {
7069 --report) _filedir 'html' ;;
7170 esac
7271
73- elif [ "x${cur:0:1}" == "x-" ]; then
72+ return
73+ fi
74+
75+ $split && return
76+
77+ if [ "x${cur:0:1}" == "x-" ]; then
7478 # an option
7579 COMPREPLY=( $(compgen -W "${opts[$modpath]}" -- ${cur}) )
7680 elif [ "x${cmds[$modpath]}" != 'x' ]; then
You can’t perform that action at this time.
0 commit comments