Ayaka Koshibe | 37cffe8 | 2015-06-01 12:01:23 -0700 | [diff] [blame] | 1 | # Options read by onos-group for help message formatting and sanity checks. |
| 2 | GOPTS='install kill patch-vm push-keys uninstall' |
Ayaka Koshibe | aec62962 | 2015-01-05 20:33:29 -0800 | [diff] [blame] | 3 | |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 4 | # Tab completion settings for onos-group. |
Ayaka Koshibe | aec62962 | 2015-01-05 20:33:29 -0800 | [diff] [blame] | 5 | function _ogroup-opts () { |
| 6 | local cur=${COMP_WORDS[COMP_CWORD]} |
Ayaka Koshibe | aec62962 | 2015-01-05 20:33:29 -0800 | [diff] [blame] | 7 | if [ $COMP_CWORD -eq 1 ]; then |
Ayaka Koshibe | 37cffe8 | 2015-06-01 12:01:23 -0700 | [diff] [blame] | 8 | COMPREPLY=( $( compgen -W "${GOPTS} help" -- $cur ) ) |
Ayaka Koshibe | aec62962 | 2015-01-05 20:33:29 -0800 | [diff] [blame] | 9 | fi |
| 10 | } |
| 11 | |
| 12 | complete -F _ogroup-opts onos-group |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 13 | |
| 14 | |
Thomas Vachuska | 4d5310c | 2016-07-14 12:48:39 -0700 | [diff] [blame] | 15 | # Tab completion settings for stc & stw |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 16 | function _stc-opts () { |
| 17 | local cur=${COMP_WORDS[COMP_CWORD]} |
Thomas Vachuska | 4d5310c | 2016-07-14 12:48:39 -0700 | [diff] [blame] | 18 | if [ $COMP_CWORD -ge 1 ]; then |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 19 | COMPREPLY=( $( compgen -W "$(cd $ONOS_ROOT/tools/test/scenarios && ls -1 | sed 's/.xml//g')" -- $cur ) ) |
| 20 | fi |
| 21 | } |
| 22 | |
| 23 | complete -F _stc-opts stc |
Thomas Vachuska | 4d5310c | 2016-07-14 12:48:39 -0700 | [diff] [blame] | 24 | complete -F _stc-opts stw |
Thomas Vachuska | e112535 | 2016-11-09 14:06:51 -0800 | [diff] [blame] | 25 | complete -F _stc-opts stcs |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 26 | |
| 27 | |
Thomas Vachuska | 969d6bc | 2015-07-29 11:56:57 -0700 | [diff] [blame] | 28 | # Tab completion settings for stl |
| 29 | function _stl-opts () { |
| 30 | local cur=${COMP_WORDS[COMP_CWORD]} |
| 31 | if [ $COMP_CWORD -eq 1 ]; then |
| 32 | COMPREPLY=( $( compgen -W "$(cd /tmp/stc && ls -1)" -- $cur ) ) |
| 33 | elif [ $COMP_CWORD -eq 2 ]; then |
| 34 | COMPREPLY=( $( compgen -W "$(cd /tmp/stc/$3 && ls -1)" -- $cur ) ) |
| 35 | fi |
| 36 | } |
| 37 | |
| 38 | complete -F _stl-opts stl |
| 39 | |
| 40 | |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 41 | # Tab completion settings for cell |
| 42 | function _cell-opts () { |
| 43 | local cur=${COMP_WORDS[COMP_CWORD]} |
| 44 | if [ $COMP_CWORD -eq 1 ]; then |
Thomas Vachuska | 1eff3a6 | 2016-05-03 01:07:24 -0700 | [diff] [blame] | 45 | COMPREPLY=( $( compgen -W "$(cd $ONOS_ROOT/tools/test/cells && ls -1) borrow return status" -- $cur ) ) |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 46 | fi |
| 47 | } |
| 48 | |
Thomas Vachuska | ea2d9fd | 2015-09-23 13:13:25 -0700 | [diff] [blame] | 49 | complete -F _cell-opts cell vicell |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 50 | |
Thomas Vachuska | cc0b7d6 | 2016-07-12 14:03:11 -0700 | [diff] [blame] | 51 | # Tab completion settings for topo recipes |
| 52 | function _topo-opts () { |
| 53 | local cur=${COMP_WORDS[COMP_CWORD]} |
| 54 | if [ $COMP_CWORD -eq 1 ]; then |
| 55 | COMPREPLY=( $( compgen -W "$(cd $ONOS_ROOT/tools/test/topos && ls -1 *.recipe | sed 's/\.recipe//g')" -- $cur ) ) |
| 56 | fi |
| 57 | } |
| 58 | |
| 59 | complete -F _topo-opts topo |
| 60 | |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 61 | |
| 62 | # Tab completion settings for onos-create-app. |
| 63 | function _ocapp-opts () { |
| 64 | local cur=${COMP_WORDS[COMP_CWORD]} |
| 65 | if [ $COMP_CWORD -eq 1 ]; then |
Sean Condon | a36f65c | 2019-05-20 08:21:41 +0100 | [diff] [blame] | 66 | COMPREPLY=( $( compgen -W "app bundle ui ui2 uitab uitopo cli rest" -- $cur ) ) |
Thomas Vachuska | 4bfccd54 | 2015-05-30 00:35:25 -0700 | [diff] [blame] | 67 | fi |
| 68 | } |
| 69 | |
| 70 | complete -F _ocapp-opts onos-create-app |