diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2018-04-07 15:12:57 +0200 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2018-04-07 15:12:57 +0200 |
commit | 6e1ab9aa550695ee7e3d467b4173c0b83ba7f759 (patch) | |
tree | 8fb7faa4364a7cbf1cba48296a5f537e13f2a8d9 /Completion/Darwin/Command/_osascript | |
parent | 5ad56a41f1ee2e61abca079f5ea8909f895ac2dd (diff) | |
parent | f027f1d6e876708bc75d4217e1ca26898658d8d3 (diff) | |
download | zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.tar.gz zsh-6e1ab9aa550695ee7e3d467b4173c0b83ba7f759.zip |
Merge tag 'zsh-5.4.2-test-2' / 'upstream' branch into 'debian' branch
Test version 2 prior to zsh 5.5.
Diffstat (limited to 'Completion/Darwin/Command/_osascript')
-rw-r--r-- | Completion/Darwin/Command/_osascript | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Completion/Darwin/Command/_osascript b/Completion/Darwin/Command/_osascript new file mode 100644 index 000000000..5e4a5f70c --- /dev/null +++ b/Completion/Darwin/Command/_osascript @@ -0,0 +1,34 @@ +#compdef osascript + +local ret=1 +local -a context line state state_descr tmp +local -A opt_args val_args + +_arguments -s -S : \ + '-l+[specify script language]: :->languages' \ + '(:)*-e+[execute specified line of script]:script' \ + '-i[run interactively]' \ + '*-s+[specify output style]: :->modifiers' \ + '(-e)1:script file:_files' \ +&& ret=0 + +case $state in + languages) + # So far, the three languages specified here are the only ones supported, + # but adding the output of osalang makes this future-proof + _values 'script language' \ + AppleScript JavaScript 'Generic Scripting System' \ + ${(f)"$( command osalang 2> /dev/null )"} \ + && ret=0 + ;; + modifiers) + _values -S '' 'output modifier flag' \ + 'h[print values in human-readable form]' \ + 's[print values in recompilable source form]' \ + 'e[print script errors to stderr]' \ + 'o[print script errors to stdout]' \ + && ret=0 + ;; +esac + +return ret |