This repository was archived by the owner on Oct 17, 2022. It is now read-only.
File tree 2 files changed +43
-0
lines changed
2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -765,3 +765,23 @@ Removing ccloudvm service
765
765
```
766
766
767
767
Once you run ccloudvm teardown, ccloudvm will be unusable until you run ccloudvm setup.
768
+
769
+ ## Misc
770
+
771
+ ### bash completion
772
+ The script that might help with auto completion is located
773
+ [ here] ( ./scripts/ccloudvm_bashcomplete ) . This can be either placed at
774
+ ` /etc/bash_completion.d/ ` of your machine or as described below.
775
+
776
+ Note: you will need to start a new shell to be able to make use of auto
777
+ completion.
778
+
779
+ ```
780
+ $ mkdir ~/.bash_completion.d
781
+ $ cp scripts/ccloudvm_bashcomplete ~/.bash_completion.d/ccloudvm
782
+ $ cat << \EOF > ~/.bash_completion
783
+ for file in ~/.bash_completion.d/*; do
784
+ [ -f "${file}" ] && . ${file}
785
+ done
786
+ EOF
787
+ ```
Original file line number Diff line number Diff line change
1
+ _ccloudvm()
2
+ {
3
+ local cur prev opts
4
+ COMPREPLY=()
5
+ cur="${COMP_WORDS[COMP_CWORD]}"
6
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
7
+ opts="connect copy create delete help instances quit run setup start status stop teardown"
8
+
9
+ case "${prev}" in
10
+ connect|delete|quit|run|start|status|stop)
11
+ local running=$(for x in `ccloudvm instances | grep -v ^Name | awk '{print $1}'`;do echo $x; done)
12
+ COMPREPLY=($(compgen -W "${running}" -- ${cur}))
13
+ return 0
14
+ ;;
15
+ *)
16
+ ;;
17
+ esac
18
+
19
+ COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
20
+ return 0
21
+
22
+ }
23
+ complete -F _ccloudvm ccloudvm
You can’t perform that action at this time.
0 commit comments