File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 33
44_sensor_data () {
55 local cur prev words cword
6- _init_completion || return
6+
7+ # Use _init_completion if available, otherwise fall back to manual setup
8+ if declare -F _init_completion > /dev/null 2>&1 ; then
9+ _init_completion || return
10+ else
11+ COMPREPLY=()
12+ cur=" ${COMP_WORDS[COMP_CWORD]} "
13+ prev=" ${COMP_WORDS[COMP_CWORD-1]} "
14+ words=(" ${COMP_WORDS[@]} " )
15+ cword=$COMP_CWORD
16+ fi
717
818 local commands=" transform list-errors summarise-errors stats"
919
@@ -42,7 +52,7 @@ _sensor_data() {
4252 case " $prev " in
4353 -o|--output)
4454 # Complete file names
45- _filedir
55+ _filedir 2> /dev/null || COMPREPLY=( $( compgen -f -- " $cur " ) )
4656 return
4757 ;;
4858 -e|--extension)
@@ -95,8 +105,8 @@ _sensor_data() {
95105 esac
96106 else
97107 # Complete file/directory names
98- _filedir
108+ _filedir 2> /dev/null || COMPREPLY=( $( compgen -f -- " $cur " ) )
99109 fi
100110}
101111
102- complete -F _sensor_data sensor-data
112+ complete -o default -o bashdefault - F _sensor_data sensor-data
You can’t perform that action at this time.
0 commit comments