Skip to content

Reconstruct the global flags content of kurator cli. #526

@Xieql

Description

@Xieql

What would you like to be added:
These flags should be placed under the corresponding sub-commands, otherwise it is user-unfriendly.

Why is this needed:
When we enter kurator -h, we will see:

Kurator builds distributed cloud-native stacks.

Usage:
kurator [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
install Install a target component
join Register a cluster or node
pipeline Print the info of kurator pipeline
tool Tool information for the component
version Print the version of kurator

Flags:
--context string name of the kubeconfig context to use
--dry-run console/log output only, make no changes.
-h, --help help for kurator
--home-dir string install path, default to $HOME/.kurator (default "/root/.kurator")
-c, --kubeconfig string path to the kubeconfig file, default to karmada apiserver config (default "/etc/karmada/karmada-apiserver.config")
--wait-interval duration interval used for checking pod ready, default value is 1s. (default 1s)
--wait-timeout duration timeout used for checking pod ready, default value is 2m. (default 2m0s)

When we enter kurator tool -h, we will see:

kurator tool -h
Tool information for the component

Usage:
  kurator tool [command]

Available Commands:
  list        list tool information

Flags:
  -h, --help   help for tool

Global Flags:
      --context string           name of the kubeconfig context to use
      --dry-run                  console/log output only, make no changes.
      --home-dir string          install path, default to $HOME/.kurator (default "/root/.kurator")
  -c, --kubeconfig string        path to the kubeconfig file, default to karmada apiserver config (default "/etc/karmada/karmada-apiserver.config")
      --wait-interval duration   interval used for checking pod ready, default value is 1s. (default 1s)
      --wait-timeout duration    timeout used for checking pod ready, default value is 2m. (default 2m0s)

In fact, the above global flags are only effective for specific sub-commands. For example, --wait-interval is only used in the kurator plugin sub-command

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions