Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
b2f8ee4f
Commit
b2f8ee4f
authored
Jul 28, 2016
by
Andrey Kurilin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix kubectl help command
PR
48d47b10
broke `kubectl help` command due to wrong check `help for help cmd` . Fixed issue #29736
parent
1d8c15ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
help.go
pkg/kubectl/cmd/help.go
+5
-4
No files found.
pkg/kubectl/cmd/help.go
View file @
b2f8ee4f
...
@@ -41,7 +41,7 @@ func NewCmdHelp(f *cmdutil.Factory, out io.Writer) *cobra.Command {
...
@@ -41,7 +41,7 @@ func NewCmdHelp(f *cmdutil.Factory, out io.Writer) *cobra.Command {
}
}
func
RunHelp
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
func
RunHelp
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
foundCmd
,
a
,
err
:=
cmd
.
Root
()
.
Find
(
args
)
foundCmd
,
_
,
err
:=
cmd
.
Root
()
.
Find
(
args
)
// NOTE(andreykurilin): actually, I did not find any cases when foundCmd can be nil,
// NOTE(andreykurilin): actually, I did not find any cases when foundCmd can be nil,
// but let's make this check since it is included in original code of initHelpCmd
// but let's make this check since it is included in original code of initHelpCmd
...
@@ -69,10 +69,11 @@ func RunHelp(cmd *cobra.Command, args []string) {
...
@@ -69,10 +69,11 @@ func RunHelp(cmd *cobra.Command, args []string) {
// if nothing is found, just print usage
// if nothing is found, just print usage
cmd
.
Root
()
.
Usage
()
cmd
.
Root
()
.
Usage
()
}
}
}
else
if
len
(
a
)
==
0
{
// help message for help command :)
cmd
.
Root
()
.
Usage
()
}
else
{
}
else
{
if
len
(
args
)
==
0
{
// help message for help command :)
foundCmd
=
cmd
}
helpFunc
:=
foundCmd
.
HelpFunc
()
helpFunc
:=
foundCmd
.
HelpFunc
()
helpFunc
(
foundCmd
,
args
)
helpFunc
(
foundCmd
,
args
)
}
}
...
...
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