Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #103 from jtyr/jtyr-recursive
Browse files Browse the repository at this point in the history
Support recursive without argument
  • Loading branch information
hidetatz authored Dec 31, 2022
2 parents ffe7415 + 1d787ce commit 2f8d86e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion kubectl/subcommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func CollectCommandlineOptions(args []string, info *SubcommandInfo) {
info.NoHeader = true
} else if args[i] == "-w" || args[i] == "--watch" {
info.Watch = true
} else if args[i] == "--recursive=true" {
} else if args[i] == "--recursive=true" || args[i] == "--recursive" {
info.Recursive = true
} else if args[i] == "-h" || args[i] == "--help" {
info.Help = true
Expand Down
3 changes: 1 addition & 2 deletions kubectl/subcommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ func TestInspectSubcommandInfo(t *testing.T) {

{"explain pod", &SubcommandInfo{Subcommand: Explain}, true},
{"explain pod --recursive=true", &SubcommandInfo{Subcommand: Explain, Recursive: true}, true},
// "--recursive true" is not acceptable by kubectl explain
{"explain pod --recursive true", &SubcommandInfo{Subcommand: Explain}, true},
{"explain pod --recursive", &SubcommandInfo{Subcommand: Explain, Recursive: true}, true},

{"version", &SubcommandInfo{Subcommand: Version}, true},
{"version --client", &SubcommandInfo{Subcommand: Version}, true},
Expand Down

0 comments on commit 2f8d86e

Please sign in to comment.