|
| 1 | +/* |
| 2 | +Copyright (c) 2020 Red Hat, Inc. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package commands |
| 18 | + |
| 19 | +import ( |
| 20 | + "github.com/spf13/cobra" |
| 21 | + |
| 22 | + "github.com/openshift/rosa/cmd/attach" |
| 23 | + "github.com/openshift/rosa/cmd/completion" |
| 24 | + "github.com/openshift/rosa/cmd/config" |
| 25 | + "github.com/openshift/rosa/cmd/create" |
| 26 | + "github.com/openshift/rosa/cmd/describe" |
| 27 | + "github.com/openshift/rosa/cmd/detach" |
| 28 | + "github.com/openshift/rosa/cmd/dlt" |
| 29 | + "github.com/openshift/rosa/cmd/docs" |
| 30 | + "github.com/openshift/rosa/cmd/download" |
| 31 | + "github.com/openshift/rosa/cmd/edit" |
| 32 | + "github.com/openshift/rosa/cmd/grant" |
| 33 | + "github.com/openshift/rosa/cmd/hibernate" |
| 34 | + "github.com/openshift/rosa/cmd/initialize" |
| 35 | + "github.com/openshift/rosa/cmd/install" |
| 36 | + "github.com/openshift/rosa/cmd/link" |
| 37 | + "github.com/openshift/rosa/cmd/list" |
| 38 | + "github.com/openshift/rosa/cmd/login" |
| 39 | + "github.com/openshift/rosa/cmd/logout" |
| 40 | + "github.com/openshift/rosa/cmd/logs" |
| 41 | + "github.com/openshift/rosa/cmd/register" |
| 42 | + "github.com/openshift/rosa/cmd/resume" |
| 43 | + "github.com/openshift/rosa/cmd/revoke" |
| 44 | + "github.com/openshift/rosa/cmd/token" |
| 45 | + "github.com/openshift/rosa/cmd/uninstall" |
| 46 | + "github.com/openshift/rosa/cmd/unlink" |
| 47 | + "github.com/openshift/rosa/cmd/upgrade" |
| 48 | + "github.com/openshift/rosa/cmd/verify" |
| 49 | + "github.com/openshift/rosa/cmd/version" |
| 50 | + "github.com/openshift/rosa/cmd/whoami" |
| 51 | +) |
| 52 | + |
| 53 | +// RegisterCommands registers all ROSA CLI subcommands to the provided root command. |
| 54 | +// This function provides a single source of truth for command registration, used by both |
| 55 | +// the main ROSA CLI (cmd/rosa/main.go) and the documentation generation tool |
| 56 | +// (tools/gendocs/gen_rosa_docs.go), ensuring docs stay in sync with the actual CLI. |
| 57 | +func RegisterCommands(root *cobra.Command) { |
| 58 | + root.AddCommand(completion.Cmd) |
| 59 | + root.AddCommand(create.Cmd) |
| 60 | + root.AddCommand(describe.Cmd) |
| 61 | + root.AddCommand(dlt.Cmd) |
| 62 | + root.AddCommand(docs.Cmd) |
| 63 | + root.AddCommand(download.Cmd) |
| 64 | + root.AddCommand(edit.Cmd) |
| 65 | + root.AddCommand(grant.Cmd) |
| 66 | + root.AddCommand(list.Cmd) |
| 67 | + root.AddCommand(initialize.Cmd) |
| 68 | + root.AddCommand(install.Cmd) |
| 69 | + root.AddCommand(login.Cmd) |
| 70 | + root.AddCommand(logout.Cmd) |
| 71 | + root.AddCommand(logs.Cmd) |
| 72 | + root.AddCommand(register.Cmd) |
| 73 | + root.AddCommand(revoke.Cmd) |
| 74 | + root.AddCommand(uninstall.Cmd) |
| 75 | + root.AddCommand(upgrade.Cmd) |
| 76 | + root.AddCommand(verify.Cmd) |
| 77 | + root.AddCommand(version.NewRosaVersionCommand()) |
| 78 | + root.AddCommand(whoami.Cmd) |
| 79 | + root.AddCommand(hibernate.GenerateCommand()) |
| 80 | + root.AddCommand(resume.GenerateCommand()) |
| 81 | + root.AddCommand(link.Cmd) |
| 82 | + root.AddCommand(unlink.Cmd) |
| 83 | + root.AddCommand(token.Cmd) |
| 84 | + root.AddCommand(config.Cmd) |
| 85 | + root.AddCommand(attach.NewRosaAttachCommand()) |
| 86 | + root.AddCommand(detach.NewRosaDetachCommand()) |
| 87 | +} |
0 commit comments