3 # Parses Java source code from STDIN and generates script for BASH completion
4 # Input (in this order):
5 # info/globalcode/sql/dk/Constants.java
6 # info/globalcode/sql/dk/formatting/*
7 # info/globalcode/sql/dk/CLIParser.java
15 if (/"(.*?)".*? \/\/\s*bash-completion:dir/) {
27 cur=${COMP_WORDS[COMP_CWORD]}
28 prev=${COMP_WORDS[COMP_CWORD-1]}
32 COMPREPLY=( $( echo "TODO_DATABASE_NAMES" ) );
37 COMPREPLY=( $( compgen -W "
41 if (/"(.*?)".*? \/\/\s*bash-completion:formatter/) {
44 last if (/\/\/\s*bash-completion:options/);
48 print ' " -- $cur ) );
53 COMPREPLY=( $( compgen -W "
57 if (/"(.*?)".*? \/\/\s*bash-completion:option/) {
67 complete -F _sql_dk sql-dk