Matteo Scandolo | a42dd35 | 2019-09-30 15:46:43 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package completion |
| 17 | |
| 18 | const Bash = ` |
| 19 | # Portions copyright 2019-present Open Networking Foundation |
| 20 | # Original copyright 2019-present Ciena Corporation |
| 21 | # |
| 22 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 23 | # you may not use this file except in compliance with the License. |
| 24 | # You may obtain a copy of the License at |
| 25 | # |
| 26 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 27 | # |
| 28 | # Unless required by applicable law or agreed to in writing, software |
| 29 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 30 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 31 | # See the License for the specific language governing permissions and |
| 32 | # limitations under the License. |
| 33 | # |
| 34 | _bbsimctl() { |
| 35 | # All arguments except the first one |
| 36 | args=("${COMP_WORDS[@]:1:$COMP_CWORD}") |
| 37 | # Only split on newlines |
| 38 | local IFS=$'\n' |
| 39 | # Call completion (note that the first element of COMP_WORDS is |
| 40 | # the executable itself) |
| 41 | COMPREPLY=($(GO_FLAGS_COMPLETION=1 ${COMP_WORDS[0]} "${args[@]}")) |
| 42 | return 0 |
| 43 | } |
| 44 | complete -F _bbsimctl bbsimctl` |