Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
9fe76d34
Commit
9fe76d34
authored
May 04, 2017
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(helm): fix go style issues in completion.go
parent
7b77bd32
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
completion.go
cmd/helm/completion.go
+7
-7
No files found.
cmd/helm/completion.go
View file @
9fe76d34
...
@@ -36,7 +36,7 @@ Can be sourced as such
...
@@ -36,7 +36,7 @@ Can be sourced as such
`
`
var
(
var
(
completion
_s
hells
=
map
[
string
]
func
(
out
io
.
Writer
,
cmd
*
cobra
.
Command
)
error
{
completion
S
hells
=
map
[
string
]
func
(
out
io
.
Writer
,
cmd
*
cobra
.
Command
)
error
{
"bash"
:
runCompletionBash
,
"bash"
:
runCompletionBash
,
"zsh"
:
runCompletionZsh
,
"zsh"
:
runCompletionZsh
,
}
}
...
@@ -44,7 +44,7 @@ var (
...
@@ -44,7 +44,7 @@ var (
func
newCompletionCmd
(
out
io
.
Writer
)
*
cobra
.
Command
{
func
newCompletionCmd
(
out
io
.
Writer
)
*
cobra
.
Command
{
shells
:=
[]
string
{}
shells
:=
[]
string
{}
for
s
:=
range
completion
_s
hells
{
for
s
:=
range
completion
S
hells
{
shells
=
append
(
shells
,
s
)
shells
=
append
(
shells
,
s
)
}
}
...
@@ -68,7 +68,7 @@ func RunCompletion(out io.Writer, cmd *cobra.Command, args []string) error {
...
@@ -68,7 +68,7 @@ func RunCompletion(out io.Writer, cmd *cobra.Command, args []string) error {
if
len
(
args
)
>
1
{
if
len
(
args
)
>
1
{
return
fmt
.
Errorf
(
"Too many arguments. Expected only the shell type."
)
return
fmt
.
Errorf
(
"Too many arguments. Expected only the shell type."
)
}
}
run
,
found
:=
completion
_s
hells
[
args
[
0
]]
run
,
found
:=
completion
S
hells
[
args
[
0
]]
if
!
found
{
if
!
found
{
return
fmt
.
Errorf
(
"Unsupported shell type %q."
,
args
[
0
])
return
fmt
.
Errorf
(
"Unsupported shell type %q."
,
args
[
0
])
}
}
...
@@ -81,7 +81,7 @@ func runCompletionBash(out io.Writer, cmd *cobra.Command) error {
...
@@ -81,7 +81,7 @@ func runCompletionBash(out io.Writer, cmd *cobra.Command) error {
}
}
func
runCompletionZsh
(
out
io
.
Writer
,
cmd
*
cobra
.
Command
)
error
{
func
runCompletionZsh
(
out
io
.
Writer
,
cmd
*
cobra
.
Command
)
error
{
zsh
_i
nitialization
:=
`
zsh
I
nitialization
:=
`
__helm_bash_source() {
__helm_bash_source() {
alias shopt=':'
alias shopt=':'
alias _expand=_bash_expand
alias _expand=_bash_expand
...
@@ -213,17 +213,17 @@ __helm_convert_bash_to_zsh() {
...
@@ -213,17 +213,17 @@ __helm_convert_bash_to_zsh() {
-e "s/\\\$(type${RWORD}/\$(__helm_type/g" \
-e "s/\\\$(type${RWORD}/\$(__helm_type/g" \
<<'BASH_COMPLETION_EOF'
<<'BASH_COMPLETION_EOF'
`
`
out
.
Write
([]
byte
(
zsh
_i
nitialization
))
out
.
Write
([]
byte
(
zsh
I
nitialization
))
buf
:=
new
(
bytes
.
Buffer
)
buf
:=
new
(
bytes
.
Buffer
)
cmd
.
Root
()
.
GenBashCompletion
(
buf
)
cmd
.
Root
()
.
GenBashCompletion
(
buf
)
out
.
Write
(
buf
.
Bytes
())
out
.
Write
(
buf
.
Bytes
())
zsh
_t
ail
:=
`
zsh
T
ail
:=
`
BASH_COMPLETION_EOF
BASH_COMPLETION_EOF
}
}
__helm_bash_source <(__helm_convert_bash_to_zsh)
__helm_bash_source <(__helm_convert_bash_to_zsh)
`
`
out
.
Write
([]
byte
(
zsh
_t
ail
))
out
.
Write
([]
byte
(
zsh
T
ail
))
return
nil
return
nil
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment