improve usage texts

pull/227/head v3.0.0-dev-20191212-0
iwilltry42 5 years ago
parent 1a91401d19
commit 8aad61a39a
  1. 2
      cmd/create/createCluster.go
  2. 2
      cmd/create/createNode.go
  3. 11
      cmd/delete/deleteCluster.go
  4. 2
      cmd/delete/deleteNode.go
  5. 3
      cmd/get/getCluster.go
  6. 2
      cmd/get/getKubeconfig.go
  7. 2
      cmd/get/getNode.go
  8. 2
      cmd/load/loadImage.go
  9. 2
      cmd/start/startCluster.go
  10. 2
      cmd/start/startNode.go
  11. 2
      cmd/stop/stopCluster.go
  12. 2
      cmd/stop/stopNode.go

@ -41,7 +41,7 @@ func NewCmdCreateCluster() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "cluster",
Use: "cluster NAME",
Short: "Create a new k3s cluster in docker",
Long: `Create a new k3s cluster with containerized nodes (k3s in docker).`,
Args: cobra.ExactArgs(1), // exactly one cluster name can be set // TODO: if not specified, use k3d.DefaultClusterName

@ -37,7 +37,7 @@ func NewCmdCreateNode() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "node",
Use: "node NAME",
Short: "Create a new k3s node in docker",
Long: `Create a new containerized k3s node (k3s in docker).`,
Args: cobra.ExactArgs(1), // exactly one name accepted // TODO: if not specified, inherit from cluster that the node shall belong to, if that is specified

@ -35,19 +35,20 @@ func NewCmdDeleteCluster() *cobra.Command {
// create new cobra command
cmd := &cobra.Command{
Use: "cluster",
Use: "cluster (NAME | --all)",
Short: "Delete a cluster.",
Long: `Delete a cluster.`,
Args: cobra.MinimumNArgs(0), // 0 or n arguments; 0 only if --all is set
Run: func(cmd *cobra.Command, args []string) {
log.Debugln("delete cluster called")
rt, cs := parseDeleteClusterCmd(cmd, args)
runtime, clusters := parseDeleteClusterCmd(cmd, args)
if len(cs) == 0 {
if len(clusters) == 0 {
log.Infoln("No clusters found")
} else {
for _, c := range cs {
if err := cluster.DeleteCluster(c, rt); err != nil {
for _, c := range clusters {
if err := cluster.DeleteCluster(c, runtime); err != nil {
log.Fatalln(err)
}
}

@ -34,7 +34,7 @@ func NewCmdDeleteNode() *cobra.Command {
// create new cobra command
cmd := &cobra.Command{
Use: "node",
Use: "node (NAME | --all)",
Short: "Delete a node.",
Long: `Delete a node.`,
Args: cobra.MinimumNArgs(1), // at least one node has to be specified

@ -42,10 +42,11 @@ func NewCmdGetCluster() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "cluster",
Use: "cluster [NAME [NAME...]]",
Aliases: []string{"clusters"},
Short: "Get cluster",
Long: `Get cluster.`,
Args: cobra.MinimumNArgs(0), // 0 or more; 0 = all
Run: func(cmd *cobra.Command, args []string) {
log.Debugln("get cluster called")
c, rt, headersOff := parseGetClusterCmd(cmd, args)

@ -37,7 +37,7 @@ func NewCmdGetKubeconfig() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "kubeconfig",
Use: "kubeconfig NAME", // TODO: enable putting more than one name or even --all
Short: "Get kubeconfig",
Long: `Get kubeconfig.`,
Args: cobra.MinimumNArgs(1),

@ -41,7 +41,7 @@ func NewCmdGetNode() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "node",
Use: "node", // TODO: set one or more names or --all flag
Short: "Get node",
Aliases: []string{"nodes"},
Long: `Get node.`,

@ -36,7 +36,7 @@ func NewCmdLoadImage() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "image",
Use: "image [IMAGE [IMAGE...]]",
Short: "Load an image from docker into a k3d cluster.",
Long: `Load an image from docker into a k3d cluster.`,
Args: cobra.MinimumNArgs(1),

@ -36,7 +36,7 @@ func NewCmdStartCluster() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "cluster",
Use: "cluster (NAME [NAME...] | --all)",
Short: "Start an existing k3d cluster",
Long: `Start an existing k3d cluster`,
Run: func(cmd *cobra.Command, args []string) {

@ -34,7 +34,7 @@ func NewCmdStartNode() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "node",
Use: "node NAME", // TODO: allow one or more names or --all
Short: "Start an existing k3d node",
Long: `Start an existing k3d node.`,
Run: func(cmd *cobra.Command, args []string) {

@ -36,7 +36,7 @@ func NewCmdStopCluster() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "cluster",
Use: "cluster (NAME [NAME...] | --all)",
Short: "Stop an existing k3d cluster",
Long: `Stop an existing k3d cluster.`,
Run: func(cmd *cobra.Command, args []string) {

@ -35,7 +35,7 @@ func NewCmdStopNode() *cobra.Command {
// create new command
cmd := &cobra.Command{
Use: "node",
Use: "node NAME", // TODO: allow one or more names or --all",
Short: "Stop an existing k3d node",
Long: `Stop an existing k3d node.`,
Run: func(cmd *cobra.Command, args []string) {

Loading…
Cancel
Save