about summary refs log tree commit diff
path: root/Completion/X/_xt_arguments
blob: 3a351563cac7b3d82736df49179f06a96a87155e (plain) (blame)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#autoload

# How to convert XrmOptionDescRec:

# XrmOptionDescRec optionDescList[] = {
#   ...
#   {option, specifier, argKind, value},
#   ...
# };

#  argKind		argument for _xt_arguments
#  XrmoptionNoArg	option
#  XrmoptionIsArg	option
#  XrmoptionStickyArg	option-:message:action
#  XrmoptionSepArg	option:message:action
#  XrmoptionResArg	option:message:_x_resource
#  XrmoptionSkipArg	option:message:action
#  XrmoptionSkipLine	option:*::message:action
#  XrmoptionSkipNArgs	option:message[1]:action[1]:...:message[value]:action[value]

# cf. XrmParseCommand(3X11), X11R6.4/xc/lib/Xt/Initialize.c, X(5)

local ret long xargs

xargs=(
  -+{rv,synchronous}
  -{reverse,iconic}
  '-background:background color:_x_color'
  '-bd:border color:_x_color'
  '-bg:background color:_x_color'
  '-bordercolor:border color:_x_color'
  '-borderwidth:border width:_x_borderwidth'
  '-bw:border width:_x_borderwidth'
  '-display:display:_x_display'
  '-fg:foreground color:_x_color'
  '-font:font:_x_font'
  '-fn:font:_x_font'
  '-foreground:foreground color:_x_color'
  '-geometry:geometry:_x_geometry'
  '-name:name:_x_name'
  '-selectionTimeout:selection timeout (milliseconds):_x_selection_timeout'
  '-title:title:_x_title'
  '-xnllanguage:locale:_x_locale'
  '*-xrm:resource:_x_resource'
  '-xtsessionID:session ID:_xt_session_id'
)

long=$argv[(I)--]
if (( long )); then
  argv[long]=( "$xargs[@]" -- )
else
  set -- "$@" "$xargs[@]"
fi

_arguments "$@"

ret=$?

[[ "$ret" = 300 ]] && compstate[restore]=''

return ret