blob: a42e5b6258609208fae3124311247fffa51b6e1f [file] [log] [blame]
Zack Williamse940c7a2019-08-21 14:25:39 -07001/*
2 * Copyright 2019-present Ciena Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package completion
17
18const Bash = `
19# Copyright 2019-present Ciena Corporation
20#
21# Licensed under the Apache License, Version 2.0 (the "License");
22# you may not use this file except in compliance with the License.
23# You may obtain a copy of the License at
24#
25# http://www.apache.org/licenses/LICENSE-2.0
26#
27# Unless required by applicable law or agreed to in writing, software
28# distributed under the License is distributed on an "AS IS" BASIS,
29# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30# See the License for the specific language governing permissions and
31# limitations under the License.
32#
33_voltctl() {
34 # All arguments except the first one
35 args=("${COMP_WORDS[@]:1:$COMP_CWORD}")
36
37 # Only split on newlines
38 local IFS=$'\n'
39
40 # Call completion (note that the first element of COMP_WORDS is
41 # the executable itself)
42 COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}"))
43 return 0
44}
45
46complete -F _voltctl voltctl
47`