FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
openapi-generator/scripts/openapi-generator-cli-completion.bash at master · dio/openapi-generator · GitHub
dio
/
openapi-generator
Public
forked from
OpenAPITools/openapi-generator
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
openapi-generator
/
scripts
/
openapi-generator-cli-completion.bash
Copy path
More file actions
More file actions
Latest commit
History
History
History
48 lines (42 loc) · 1.48 KB
Breadcrumbs
openapi-generator
/
scripts
/
openapi-generator-cli-completion.bash
Copy path
File metadata and controls
48 lines (42 loc) · 1.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!
/usr/bin/env bash
#
##
#
Provides completion assistance for openapi-generator-cli
#
Install
#
Mac:
#
brew install bash-completion
#
cp openapi-generator-cli-completion.bash `brew --prefix`/etc/bash_completion.d
#
Linux: many distributions include this automatically. Search for your distro-specific instructions.
#
When in doubt, try sourcing this file:
#
type complete && source openapi-generator-cli
#
#
see http://tldp.org/LDP/abs/html/tabexpansion.html
#
##
_openapi_generator_cli_completions
() {
COMPREPLY=()
local
IFS=
$'
\t\n
'
local
options=()
options+=(
"
$(
$1
completion
${COMP_WORDS[@]
:
1}
)
"
)
case
"
${COMP_WORDS[1]}
"
in
generate)
case
"
${COMP_WORDS[@]
:
2}
"
in
-l|--lang|-g|--generator-name)
#
TODO: This is a nice-to-have and not required.
#
Apply generator-specific options to additional properties. These can be queried via:
#
openapi-generator-cli config-help -l YOUR_LANG | grep '^\t' | grep -v '^\t\s\s\s\s' | tr -d '\t'
#
where YOUR_LANG would need to be evaluated as the value after the current switch.
#
but rather than switching on 'generate' maybe switch on --additional-properties?
;;
esac
;;
*
)
#
ignore
;;
esac
#
printf '%s\n' "${options[@]}"
if
[[
-n
"
${options[@]}
"
]]
;
then
COMPREPLY=(
$(
compgen -W
"
${options}
"
--
${2}
)
)
fi
}
for
i
in
openapi-generator-cli openapi-generator
;
do
type
$i
>
/dev/null
2>&1
&&
complete
-F _openapi_generator_cli_completions
$i
done
Back
|
FazBrowse Home
|
New Git URL