zsh-workers
 help / color / mirror / code / Atom feed
5e4a5f70c16f54df04a8da2199ec458bd84742fd blob 956 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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
debug log:

solving 5e4a5f70c ...
found 5e4a5f70c in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).