causes Posted October 22, 2014 Report Share Posted October 22, 2014 I would like to learn to write bash completion modules. The available documentation is poor. So i would like to get help writing completion for cpupower. I already have completion for first argument working. Next i would like to get completion for -g <governor> working. Please reply if you can help me :-). Here is what i have already: /usr/share/bash-completion/completions/cpupower _cpupower() { # pointer to current and prev completion word local cur prev # completion options local opts # array storing the possible completions COMPREPLY=() # define cur and prev cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" opts="frequency-info frequency-set idle-info idle-set set info monitor help" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) } complete -F _cpupower cpupower Link to comment Share on other sites More sharing options...
Recommended Posts