summaryrefslogtreecommitdiff
path: root/Completion/Unix/Command/_sqlite
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-08-27 13:31:04 +0200
committerAxel Beckert <abe@deuxchevaux.org>2018-08-27 13:31:04 +0200
commit719a715614f2182a76b30ad27a327d70a86f34f1 (patch)
treea437eb29da8035bf7c2e30506c08fe6f15719871 /Completion/Unix/Command/_sqlite
parent7da8d19c224860ae4d6aa3f077fca7f734f20d88 (diff)
parentef61918398517473b9b594690a3be375f607cebe (diff)
downloadzsh-719a715614f2182a76b30ad27a327d70a86f34f1.tar.gz
zsh-719a715614f2182a76b30ad27a327d70a86f34f1.zip
Merge tag 'zsh-5.5.1-test-2' into debian
Test release: 5.5.1-test-2.
Diffstat (limited to 'Completion/Unix/Command/_sqlite')
-rw-r--r--Completion/Unix/Command/_sqlite27
1 files changed, 23 insertions, 4 deletions
diff --git a/Completion/Unix/Command/_sqlite b/Completion/Unix/Command/_sqlite
index 58f7a9116..4604fb40c 100644
--- a/Completion/Unix/Command/_sqlite
+++ b/Completion/Unix/Command/_sqlite
@@ -1,6 +1,6 @@
#compdef sqlite sqlite3
-local ret opt display_opt sqlite3
+local opt display_opt sqlite3 ign
local -a options output_modes exclusive dashes
[[ $service = sqlite3 ]] && sqlite3=true || unset sqlite3
@@ -31,16 +31,18 @@ for display_opt in $output_modes ; do
options+=( "($exclusive)"$^dashes"-${opt}[set output mode to $display_opt]" )
done
+(( $#words == 2 )) || ign='!'
options+=(
$^dashes'-separator[set output field separator]:output field separator [|]'
$^dashes'-nullvalue[set text string for null values]:string'
- '(- :)'$^dashes'-version[show SQLite version]'
- '(- :)'$^dashes'-help[show help]'
+ "$ign(- :)"$^dashes'-version[show SQLite version]'
+ "$ign(- :)"$^dashes'-help[show help]'
'1:SQLite database file:_files'
- '(- :)2:SQL to run'
+ '(- :)2: :_guard "^-*" "SQL to run"'
)
(( $+sqlite3 )) && options+=(
+ $^dashes'-A+[run .archive with arguments and exit]'
$^dashes'-append[append the database to the end of the file]'
$^dashes'-bail[stop after hitting an error]'
$^dashes'-cmd[run specified command before reading stdin]:sqlite meta-command'
@@ -53,6 +55,23 @@ options+=(
$^dashes'-readonly[open the database read-only]'
$^dashes'-stats[print memory stats before each finalize]'
$^dashes'-vfs[use specified default VFS]:vfs:(unix-dotfile unix-excl unix-none unix-namedsem)'
+ $^dashes'-zip[open the file as a ZIP Archive]'
)
+if [[ -n $words[(r)-A*] ]]; then
+ options=( -s -w : '(-A --A)'${^dashes}-A "(-f --file -a --append)"${(M)options:#1:*}
+ '(-v --verbose)'{-v,--verbose}'[print each filename as it is processed]'
+ '(1 -a --append -f --file)'{-f+,--file=}'[specify archive file]:archive file:_files'
+ '(1 -a --append -f --file)'{-a,--append=}'[operate on specified file opened using the apndvfs VFS]:archive file:_files'
+ '(-C --directory)'{-C+,--directory=}'[change to specified directory to read/extract files]:directory:_directories'
+ '(-n --dryrun)'{-n,--dryrun}'[show the SQL that would have occurred]'
+ '*:file:_files'
+ + '(commands)' \
+ '(-c --create)'{-c,--create}'[create a new archive]'
+ '(-u --update)'{-u,--update}'[update or add files to an existing archive]'
+ '(-t --list)'{-t,--list}'[list contents of archive]'
+ '(-x --extract)'{-x,--extract}'[extract files from archive]'
+ )
+fi
+
_arguments $options