forked from zsh-users/zsh-completions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
_jonas
120 lines (115 loc) · 6.04 KB
/
_jonas
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#compdef jonas
# ------------------------------------------------------------------------------
# Copyright (c) 2011 Github zsh-users - https://github.com/zsh-users
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the zsh-users nor the
# names of its contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL ZSH-USERS BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for JOnAS 5.2 (http://jonas.ow2.org).
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Julien Nicoulaud <[email protected]>
#
# ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
# vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext" ret=1
_arguments -C \
'1:cmd:->cmds' \
'*::arg:->args' \
&& ret=0
case "$state" in
(cmds)
local commands; commands=(
'version:show version information'
'check:check that the JOnAS environment is correctly set'
'start:start a server instance'
'stop:stop a server instance'
'admin:administrate a server instance'
)
_describe -t commands 'command' commands && ret=0
;;
(args)
curcontext="${curcontext%:*:*}:jonas-cmd-$words[1]:"
case $words[1] in
(version|check)
_message 'no more arguments' && ret=0
;;
(start)
_arguments \
'-standby[start a minimal JOnAS server with only mandatory services]' \
'(-bg)-fg[start the server in foreground mode]' \
'(-fg)-bg[start the server in background mode]' \
'-win[start the server in a new window]' \
'(-bg)-tui[start the Apache Felix TUI (force foreground mode)]' \
'-gui[start the Apache Felix GUI]' \
'-dev[start a JOnAS server by using bundles present in the default maven repository instead of bundles under $JONAS_ROOT/lib/bundles]' \
'-clean[clean the Apache Felix cache before starting a JOnAS server]' \
'-n[set the server name, must be unique in the domain (default: jonas)]:name' \
'-target[start another server or cluster (group of servers) in the domain]:server' \
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
&& ret=0
;;
(stop)
_arguments \
'-standby[stop all services except the mandatory ones]' \
'-n[set the name of the server to stop (default: jonas)]:name' \
'-target[stop another server or cluster (group of servers) in the domain]:server' \
'-Ddomain.name=[set the name of the management domain to which the server belongs]:domain' \
&& ret=0
;;
(admin)
_arguments \
'(- : *)-?[print the help message]' \
'-win[administer the server in a new window]' \
'-n[set the name of the server to administer (default: jonas)]:name' \
'-username[set the username when authentication is required]: :_users' \
'-password[set the password when authentication is required]:password' \
'-registry[set the registry URL]: :_urls' \
'-protocol[set the protocol name]:protocol:((jrmp\:JRE\ implementation\ of\ RMI\ on\ the\ JRMP\ protocol\ \(default\) iiop\:JacORB\ implementation\ of\ RMI\ over\ the\ IIOP\ protocol irmi\:Oracle\ JRE\ independant\ implementation\ of\ RMI))' \
'-a[deploy an application from a given filepath on the current server, or on another target in the domain if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
'-r[undeploy a previously deployed application from the current server or from the specified target if the current server is a master]:Java application archive:_files -g "*.(j|w|r|e)ar"' \
'-gc[run the garbage collector on the current JOnAS server]' \
'-passivate[passivate all entity bean instances]' \
'-e[list the properties of the current JOnAS server]' \
'-j[list the registered JNDI names, as seen by the current JOnAS server]' \
'-l[list the beans currently loaded by the current JOnAS server]' \
'-synch[synchronize the entity bean instances on the current JOnAS server]' \
'-debug[set the logging level for the given topic to DEBUG]:topic' \
'-tt[change the default timeout for transactions]:timeout (seconds)' \
'-ping[wait until the JOnAS server is available]' \
'-timeout[maximum time to wait when -ping is used]:timeout (seconds)' \
&& ret=0
;;
esac
;;
esac
return ret