Revision 23826,
437 bytes
checked in by broder, 15 years ago
(diff) |
In athrun:
* Don't spew errors in bash completion if /mit doesn't exist.
|
Rev | Line | |
---|
[23801] | 1 | _athrun () { |
---|
| 2 | COMPREPLY=() |
---|
[23806] | 3 | local cur="${COMP_WORDS[$COMP_CWORD]}" |
---|
| 4 | |
---|
| 5 | if [ $COMP_CWORD -eq 1 ]; then |
---|
| 6 | local IFS=$'\n' |
---|
[23826] | 7 | COMPREPLY=( $(cd /mit 2>/dev/null && compgen -f -- "$cur") ) |
---|
[23806] | 8 | elif [ $COMP_CWORD -eq 2 ]; then |
---|
| 9 | local IFS=$'\n' |
---|
| 10 | COMPREPLY=( $(dir="$(eval "athdir /mit/${COMP_WORDS[1]}")" && \ |
---|
| 11 | cd "$dir" && compgen -f -- "$cur") ) |
---|
| 12 | else |
---|
| 13 | COMP_WORDS[1]=-dummy |
---|
| 14 | _command |
---|
[23801] | 15 | fi |
---|
| 16 | } |
---|
[23806] | 17 | complete -F _athrun $filenames athrun |
---|
Note: See
TracBrowser
for help on using the repository browser.