@@ -11,6 +11,7 @@ import (
1111 "github.com/buildkite/cli/v3/cmd/build"
1212 "github.com/buildkite/cli/v3/cmd/cluster"
1313 "github.com/buildkite/cli/v3/cmd/job"
14+ "github.com/buildkite/cli/v3/cmd/whoami"
1415 "github.com/buildkite/cli/v3/internal/cli"
1516 bkErrors "github.com/buildkite/cli/v3/internal/errors"
1617 "github.com/buildkite/cli/v3/internal/version"
@@ -27,20 +28,20 @@ type CLI struct {
2728 Quiet bool `help:"Suppress progress output" short:"q"`
2829 // Verbose bool `help:"Enable verbose error output" short:"V"` // TODO: Implement this, atm this is just a skeleton flag
2930
30- Agent AgentCmd `cmd:"" help:"Manage agents"`
31- Api ApiCmd `cmd:"" help:"Interact with the Buildkite API"`
32- Artifacts ArtifactsCmd `cmd:"" help:"Manage pipeline build artifacts"`
33- Build BuildCmd `cmd:"" help:"Manage pipeline builds"`
34- Cluster ClusterCmd `cmd:"" help:"Manage organization clusters"`
35- Configure ConfigureCmd `cmd:"" help:"Configure Buildkite API token"`
36- Init InitCmd `cmd:"" help:"Initialize a pipeline.yaml file"`
37- Job JobCmd `cmd:"" help:"Manage jobs within a build"`
38- Pipeline PipelineCmd `cmd:"" help:"Manage pipelines"`
39- Package PackageCmd `cmd:"" help:"Manage packages"`
40- Use UseCmd `cmd:"" help:"Select an organization"`
41- User UserCmd `cmd:"" help:"Invite users to the organization"`
42- Version VersionCmd `cmd:"" help:"Print the version of the CLI being used"`
43- Whoami WhoamiCmd `cmd:"" help:"Print the current user and organization"`
31+ Agent AgentCmd `cmd:"" help:"Manage agents"`
32+ Api ApiCmd `cmd:"" help:"Interact with the Buildkite API"`
33+ Artifacts ArtifactsCmd `cmd:"" help:"Manage pipeline build artifacts"`
34+ Build BuildCmd `cmd:"" help:"Manage pipeline builds"`
35+ Cluster ClusterCmd `cmd:"" help:"Manage organization clusters"`
36+ Configure ConfigureCmd `cmd:"" help:"Configure Buildkite API token"`
37+ Init InitCmd `cmd:"" help:"Initialize a pipeline.yaml file"`
38+ Job JobCmd `cmd:"" help:"Manage jobs within a build"`
39+ Pipeline PipelineCmd `cmd:"" help:"Manage pipelines"`
40+ Package PackageCmd `cmd:"" help:"Manage packages"`
41+ Use UseCmd `cmd:"" help:"Select an organization"`
42+ User UserCmd `cmd:"" help:"Invite users to the organization"`
43+ Version VersionCmd `cmd:"" help:"Print the version of the CLI being used"`
44+ Whoami whoami. WhoAmICmd `cmd:"" help:"Print the current user and organization"`
4445}
4546
4647// Hybrid delegation commands, we should delete from these when native Kong implementations ready
@@ -99,9 +100,6 @@ type (
99100 UseCmd struct {
100101 Args []string `arg:"" optional:"" passthrough:"all"`
101102 }
102- WhoamiCmd struct {
103- Args []string `arg:"" optional:"" passthrough:"all"`
104- }
105103)
106104
107105// Delegation methods, we should delete when native Kong implementations ready
@@ -113,7 +111,6 @@ func (a *ApiCmd) Run(cli *CLI) error { return cli.delegateToCobraSystem("a
113111func (c * ConfigureCmd ) Run (cli * CLI ) error { return cli .delegateToCobraSystem ("configure" , c .Args ) }
114112func (i * InitCmd ) Run (cli * CLI ) error { return cli .delegateToCobraSystem ("init" , i .Args ) }
115113func (u * UseCmd ) Run (cli * CLI ) error { return cli .delegateToCobraSystem ("use" , u .Args ) }
116- func (w * WhoamiCmd ) Run (cli * CLI ) error { return cli .delegateToCobraSystem ("whoami" , w .Args ) }
117114
118115// delegateToCobraSystem delegates execution to the legacy Cobra command system.
119116// This is a temporary bridge during the Kong migration that ensures backwards compatibility
@@ -281,6 +278,10 @@ func isHelpRequest() bool {
281278 return false
282279 }
283280
281+ if len (os .Args ) >= 2 && os .Args [1 ] == "whoami" {
282+ return false
283+ }
284+
284285 if len (os .Args ) == 3 && (os .Args [2 ] == "-h" || os .Args [2 ] == "--help" ) {
285286 return true
286287 }
0 commit comments