File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,6 +30,9 @@ task :package do
3030 sh 'mkdir -p build/package/usr/local/bin/'
3131 sh 'cp -r bin/* build/package/usr/local/bin/'
3232
33+ sh 'mkdir -p build/package/etc'
34+ sh 'cp -r etc/* build/package/etc'
35+
3336 arguments = [
3437 '--description' , 'orchestration tool' ,
3538 '--url' , 'https://github.com/tim-group/orc' ,
Original file line number Diff line number Diff line change 1+ # Provides bash completion for the orc command
2+ # Currently supports completing all long options, environment and application.
3+ #
4+ # Potential improvements:
5+ # * the set of options should be generated by orc code, so it remains in sync when new options are added
6+ # * once --environment has been specified, filter applications to only those in that environment, and vice-versa
7+
8+ _orc()
9+ {
10+ CMDB_HOME=$HOME/.cmdb
11+
12+ local cur=${COMP_WORDS[COMP_CWORD]}
13+ local prev=${COMP_WORDS[COMP_CWORD-1]}
14+
15+ case "$prev" in
16+ -e|--environment)
17+ local all_environments="$(ls -1 $CMDB_HOME)"
18+ COMPREPLY=( $(compgen -W "${all_environments}" -- "$cur" ))
19+ return 0
20+ ;;
21+ -a|--application)
22+ local all_applications="$(find $CMDB_HOME -name "*.yaml" -type f -exec basename {} ';' | sed -e 's/.yaml//g' | sort | uniq )"
23+ COMPREPLY=( $(compgen -W "${all_applications}" -- "$cur" ))
24+ return 0
25+ ;;
26+ esac
27+
28+ COMPREPLY=( $(compgen -W "--debug --environment --promote-from --application\
29+ --version --group --status --deploy --install \
30+ --limited-install --swap --resolve --promote" -- "$cur") )
31+
32+ }
33+ complete -F _orc orc
You can’t perform that action at this time.
0 commit comments