diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2012-02-21 21:52:09 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2012-02-21 21:52:55 +0100 |
commit | b561eedd8b1d70a2b3339d167348771f1a8fc5c7 (patch) | |
tree | a7d7d32a90f391767a921a5fcdb59551cdffa04e /Completion/Unix/Command/_sqlite | |
parent | 340a3b41e51e3f39249a9e28f0615b063f073a3c (diff) | |
parent | 5f25bb8223d090d13af5869893fa35e5b8c44182 (diff) | |
download | zsh-b561eedd8b1d70a2b3339d167348771f1a8fc5c7.tar.gz zsh-b561eedd8b1d70a2b3339d167348771f1a8fc5c7.zip |
New upstream release
Merge branch 'upstream' into debian
Diffstat (limited to 'Completion/Unix/Command/_sqlite')
-rw-r--r-- | Completion/Unix/Command/_sqlite | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_sqlite b/Completion/Unix/Command/_sqlite new file mode 100644 index 000000000..05027c603 --- /dev/null +++ b/Completion/Unix/Command/_sqlite @@ -0,0 +1,50 @@ +#compdef sqlite sqlite3 + +local ret opt display_opt sqlite3 +local -a options output_modes exclusive dashes + +[[ $service = sqlite3 ]] && sqlite3=true || unset sqlite3 + +# sqlite options require a single hyphen, but +# sqlite3 allows options with one or two +dashes=( '' ) +(( $+sqlite3 )) && dashes+=( - ) + +options=( + '(-init --init)'$^dashes'-init[startup file]:file containing SQLite commands:_files' + $^dashes'-echo[echo commands]' +) + +exclusive=( {,-}-{no,}header ) +options+=( + "($exclusive)"$^dashes'-header[turn headers on]' + "($exclusive)"$^dashes'-noheader[turn headers off]' +) + +output_modes=( column HTML line list ) +(( $+sqlite3 )) && output_modes+=( csv ) +exclusive=( $^dashes-${^output_modes:l} ) +for display_opt in $output_modes ; do + # finagle the description to match the way SQLite's -help formats them + opt=$display_opt:l + [[ $opt = $display_opt ]] && display_opt="'$display_opt'" + options+=( "($exclusive)"$^dashes"-${opt}[set output mode to $display_opt]" ) +done + +options+=( + $^dashes'-separator[set output field separator]:string to separate output fields:' + $^dashes'-nullvalue[set null value string]:string for NULL values:' + '(- :)'$^dashes'-version[show SQLite version]' + '(- :)'$^dashes'-help[show help]' + '1:SQLite database file:_files' + '(- :)2:SQL to run' +) + +(( $+sqlite3 )) && options+=( + $^dashes'-bail[stop after hitting an error]' + '(-*batch -*interactive)'$^dashes'-batch[force batch I/O]' + '(-*batch -*interactive)'$^dashes'-interactive[force interactive I/O]' + $^dashes'-stats[print memory stats before each finalize]' +) + +_arguments $options |