-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsapcontrol.completion
More file actions
159 lines (119 loc) · 7.66 KB
/
sapcontrol.completion
File metadata and controls
159 lines (119 loc) · 7.66 KB
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# sapcontrol completion -*- shell-script -*-
# This bash completions script was generated by
# completely (https://github.com/dannyben/completely)
# Modifying it manually is not recommended
_sapcontrol_completions_filter() {
local words="$1"
local cur=${COMP_WORDS[COMP_CWORD]}
local result=()
if [[ "${cur:0:1}" == "-" ]]; then
echo "$words"
else
for word in $words; do
[[ "${word:0:1}" != "-" ]] && result+=("$word")
done
echo "${result[*]}"
fi
}
_sapcontrol_completions() {
local cur=${COMP_WORDS[COMP_CWORD]}
local compwords=("${COMP_WORDS[@]:1:$COMP_CWORD-1}")
local compline="${compwords[*]}"
case "$compline" in
''*'-function ConfigureLogFileList remove')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function ConfigureLogFileList add')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function ConfigureLogFileList set')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function ConfigureLogFileList')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "set add remove")" -- "$cur" )
;;
''*'-function ReadDeveloperTrace')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function EnqRemoveUserLocks')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A user -- "$cur" )
;;
''*'-function RequestLogonFile')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A user -- "$cur" )
;;
''*'-function DeleteSnapshots')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function CheckParameter')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function ReadConfigFile')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function InstanceStart')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A hostname -- "$cur" )
;;
''*'-function RestartSystem')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "ALL SCS DIALOG ABAP J2EE TREX ENQREP HDB ALLNOHDB LEVEL")" -- "$cur" )
;;
''*'-function GetCallstack')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "$(find /proc/ -maxdepth 1 -user "${USER}" -name '[0-9]*' -printf '%P ')")" -- "$cur" )
;;
''*'-function StartService')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "$([ -e /usr/sap ] && find /usr/sap/ -maxdepth 1 -name '[A-Z0-9][A-Z0-9][A-Z0-9]' -type d -printf '%P')")" -- "$cur" )
;;
''*'-function InstanceStop')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A hostname -- "$cur" )
;;
''*'-function ReadSnapshot')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function StartSystem')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "ALL SCS DIALOG ABAP J2EE TREX ENQREP HDB ALLNOHDB LEVEL")" -- "$cur" )
;;
''*'-function StopSystem')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "ALL SCS DIALOG ABAP J2EE TREX ENQREP HDB ALLNOHDB LEVEL")" -- "$cur" )
;;
''*'-function SendSignal')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "$(find /proc/ -maxdepth 1 -user "${USER}" -name '[0-9]*' -printf '%P ')")" -- "$cur" )
;;
''*'-function DeletePSE')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function OSExecute')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A command -- "$cur" )
;;
''*'-function Bootstrap')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A hostname -- "$cur" )
;;
''*'-systempki')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-function')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "Start InstanceStart Bootstrap Stop InstanceStop Shutdown RestartInstance StopService StartService RestartService ParameterValue GetStartProfile GetTraceFile ListConfigFiles ReadConfigFile GetAlertTree GetAlerts GetEnvironment GetVersionInfo GetQueueStatistic GetProcessList GetInstanceProperties ListDeveloperTraces ReadDeveloperTrace ListLogFiles ReadLogFile AnalyseLogFiles ConfigureLogFileList GetLogFileList CreateSnapshot ReadSnapshot ListSnapshots DeleteSnapshots GetAccessPointList GetProcessParameter SetProcessParameter SetProcessParameter2 CheckParameter OSExecute SendSignal GetCallstack GetSystemInstanceList StartSystem StopSystem RestartSystem GetSystemUpdateList UpdateSystem UpdateSCSInstance CheckUpdateSystem AccessCheck GetSecNetworkId GetNetworkId RequestLogonFile UpdateSystemPKI UpdateInstancePSE StorePSE DeletePSE CheckPSE CreatePSECredential HACheckConfig HACheckFailoverConfig HAGetFailoverConfig HAFailoverToNode HASetMaintenanceMode HACheckMaintenanceMode ABAPReadSyslog ABAPReadRawSyslog ABAPGetWPTable ABAPGetComponentList ABAPCheckRFCDestinations ABAPGetSystemWPTable ABAPSetServerInactive J2EEControlProcess J2EEControlCluster J2EEEnableDbgSession J2EEDisableDbgSession J2EEGetProcessList J2EEGetProcessList2 J2EEGetThreadList J2EEGetThreadList2 J2EEGetThreadCallStack J2EEGetThreadTaskStack J2EEGetSessionList J2EEGetCacheStatistic J2EEGetCacheStatistic2 J2EEGetApplicationAliasList J2EEGetComponentList J2EEControlComponents J2EEGetWebSessionList J2EEGetWebSessionList2 J2EEGetEJBSessionList J2EEGetRemoteObjectList J2EEGetVMGCHistory J2EEGetVMGCHistory2 J2EEGetVMHeapInfo J2EEGetClusterMsgList J2EEGetSharedTableInfo ICMGetThreadList ICMGetConnectionList ICMGetProxyConnectionList ICMGetCacheEntries WebDispGetServerList WebDispGetGroupList WebDispGetVirtHostList WebDispGetUrlPrefixList EnqGetStatistic EnqGetLockTable EnqRemoveUserLocks <user> GWGetConnectionList GWGetClientList GWCancelConnections GWDeleteConnections GWDeleteClients StartWait StopWait WaitforStarted WaitforStopped RestartServiceWait WaitforServiceStarted CheckHostAgent CheckSystemCertificates")" -- "$cur" )
;;
''*'-format')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "list script custom")" -- "$cur" )
;;
''*'-trace')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -- "$cur" )
;;
''*'-host')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A hostname -- "$cur" )
;;
''*'-user')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A user -- "$cur" )
;;
''*'-prot')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "NI_HTTP NI_HTTPS GSOAP_HTTP WINHTTP WINHTTPS PIPE")" -- "$cur" )
;;
''*'-nr')
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "$(echo {00..98})")" -- "$cur" )
;;
*)
while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "$(_sapcontrol_completions_filter "-prot -trace -debug -user -queryuser -repeat -format -host -systempki -tio -tmax -nr -function")" -- "$cur" )
;;
esac
} &&
complete -F _sapcontrol_completions sapcontrol
# ex: filetype=sh