lunch 뒤에 옵션들을 자동으로 채워주는 예제.
1 2 3 4 5 6 7 8 9 10 11 12 | # Tab completion for lunch. function _lunch() { local cur prev opts COMPREPLY=() cur= "${COMP_WORDS[COMP_CWORD]}" prev= "${COMP_WORDS[COMP_CWORD-1]}" COMPREPLY=( $(compgen -W "${LUNCH_MENU_CHOICES[*]}" -- ${cur}) ) return 0 } complete -F _lunch lunch |
The process of applying these completion specifications when word completion is attempted is described above under Programmable Completion.
Other options, if specified, have the following meanings. The arguments to the -G, -W, and -Xoptions (and, if necessary, the -P and -S options) should be quoted to protect them from expansion before the complete builtin is invoked.
The return value is true unless an invalid option is supplied, an option other than -p or -ris supplied without a name argument, an attempt is made to remove a completion specification for a name for which no specification exists, or an error occurs adding a completion specification.
Designed by sketchbooks.co.kr / sketchbook5 board skin
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5
Sketchbook5, 스케치북5