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
7c5363b0
Commit
7c5363b0
authored
May 04, 2017
by
Michelle Noorali
Committed by
GitHub
May 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2392 from michelleN/fix-style-issues
chore(helm): fix go style issues in completion.go
parents
5a3692a7
9fe76d34
Hide 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 @
7c5363b0
...
@@ -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