Skip to content

Commit

Permalink
docs: improve command usage documentation
Browse files Browse the repository at this point in the history
This PR makes command usage documentation consistent by enforcing [docopt](http://docopt.org/) rules and also defining and documenting other additional conventions.
  • Loading branch information
phm07 committed Mar 8, 2024
1 parent 4712950 commit 54faaca
Show file tree
Hide file tree
Showing 92 changed files with 107 additions and 92 deletions.
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ goreleaser --snapshot --skip-publish --rm-dist

## Conventions

### Command usage

Command usage descriptions (namely `cobra.Command.Use`) should follow the [docopt](http://docopt.org/) syntax.

Additionally:
- Optional flags should be the first in the usage string.
- If there is more than one optional flag, you can use `[options]` to abbreviate.
- Required flags should always be documented explicitly and after the positional arguments.

### Subcommand groups

Cobra offers the functionality to group subcommands. The conventions on when and how to group commands are as follows:
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/all/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ var ListCmd = base.Cmd{
}

cmd := &cobra.Command{
Use: "list FLAGS",
Use: "list [options]",
Short: "List all resources in the project",
Long: `List all resources in the project. This does not include static/public resources like locations, public ISOs, etc.
Expand Down
7 changes: 6 additions & 1 deletion internal/cmd/base/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ type DeleteCmd struct {

// CobraCommand creates a command that can be registered with cobra.
func (dc *DeleteCmd) CobraCommand(s state.State) *cobra.Command {
opts := ""
if dc.AdditionalFlags != nil {
opts = "[options] "
}

cmd := &cobra.Command{
Use: fmt.Sprintf("delete [FLAGS] %s", strings.ToUpper(dc.ResourceNameSingular)),
Use: fmt.Sprintf("delete %s<%s>", opts, strings.ToLower(dc.ResourceNameSingular)),
Short: dc.ShortDescription,
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(dc.NameSuggestions(s.Client()))),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/base/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type DescribeCmd struct {
// CobraCommand creates a command that can be registered with cobra.
func (dc *DescribeCmd) CobraCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("describe [FLAGS] %s", strings.ToUpper(dc.ResourceNameSingular)),
Use: fmt.Sprintf("describe [options] <%s>", strings.ToLower(dc.ResourceNameSingular)),
Short: dc.ShortDescription,
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(dc.NameSuggestions(s.Client()))),
Expand Down
4 changes: 2 additions & 2 deletions internal/cmd/base/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type LabelCmds struct {
// AddCobraCommand creates a command that can be registered with cobra.
func (lc *LabelCmds) AddCobraCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("add-label [FLAGS] %s LABEL...", strings.ToUpper(lc.ResourceNameSingular)),
Use: fmt.Sprintf("add-label [--overwrite] <%s> <label>...", strings.ToLower(lc.ResourceNameSingular)),
Short: lc.ShortDescriptionAdd,
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(lc.NameSuggestions(s.Client()))),
Expand Down Expand Up @@ -89,7 +89,7 @@ func validateAddLabel(_ *cobra.Command, args []string) error {
// RemoveCobraCommand creates a command that can be registered with cobra.
func (lc *LabelCmds) RemoveCobraCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("remove-label [FLAGS] %s LABEL...", strings.ToUpper(lc.ResourceNameSingular)),
Use: fmt.Sprintf("remove-label <%s> (--all | <label>...)", strings.ToLower(lc.ResourceNameSingular)),
Short: lc.ShortDescriptionRemove,
Args: cobra.MinimumNArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/base/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (lc *ListCmd) CobraCommand(s state.State) *cobra.Command {
outputColumns := lc.OutputTable(s.Client()).Columns()

cmd := &cobra.Command{
Use: "list [FlAGS]",
Use: "list [options]",
Short: fmt.Sprintf("List %s", lc.ResourceNamePlural),
Long: util.ListLongDescription(
fmt.Sprintf("Displays a list of %s.", lc.ResourceNamePlural),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/base/set_rdns.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type SetRdnsCmd struct {
// CobraCommand creates a command that can be registered with cobra.
func (rc *SetRdnsCmd) CobraCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("set-rdns [FLAGS] %s", strings.ToUpper(rc.ResourceNameSingular)),
Use: fmt.Sprintf("set-rdns [options] <%s> --hostname <hostname>", strings.ToLower(rc.ResourceNameSingular)),
Short: rc.ShortDescription,
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(rc.NameSuggestions(s.Client()))),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/base/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type UpdateCmd struct {
// CobraCommand creates a command that can be registered with cobra.
func (uc *UpdateCmd) CobraCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("update [FLAGS] %s", strings.ToUpper(uc.ResourceNameSingular)),
Use: fmt.Sprintf("update [options] <%s>", strings.ToLower(uc.ResourceNameSingular)),
Short: uc.ShortDescription,
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(uc.NameSuggestions(s.Client()))),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/certificate/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
var CreateCmd = base.CreateCmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "create [FLAGS]",
Use: "create [options] --name <name> (--type managed | --type uploaded --cert-file <file> --key-file <file>)",
Short: "Create or upload a Certificate",
Args: cobra.ExactArgs(0),
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

func NewCommand(_ state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "completion [FLAGS] SHELL",
Use: "completion <shell>",
Short: "Output shell completion code for the specified shell",
Long: `To load completions:
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/active.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func newActiveCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "active [FLAGS]",
Use: "active",
Short: "Show active context",
Args: cobra.NoArgs,
TraverseChildren: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

func NewCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "context [FLAGS]",
Use: "context",
Short: "Manage contexts",
Args: cobra.NoArgs,
TraverseChildren: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (

func newCreateCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "create [FLAGS] NAME",
Use: "create <name>",
Short: "Create a new context",
Args: cobra.ExactArgs(1),
TraverseChildren: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func newDeleteCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "delete [FLAGS] NAME",
Use: "delete <context>",
Short: "Delete a context",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidates(config.ContextNames(s.Config())...)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func init() {

func newListCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "list [FLAGS]",
Use: "list [options]",
Short: "List contexts",
Long: util.ListLongDescription(
"Displays a list of contexts.",
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/context/use.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

func newUseCommand(s state.State) *cobra.Command {
cmd := &cobra.Command{
Use: "use [FLAGS] NAME",
Use: "use <context>",
Short: "Use a context",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidates(config.ContextNames(s.Config())...)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/add_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var AddRuleCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "add-rule FIREWALL FLAGS",
Use: "add-rule [options] <firewall> (--direction in --source-ips <ips> | --direction out --destination-ips <ips>) --protocol <icmp|udp|tcp|esp|gre>",
Short: "Add a single rule to a firewall",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.Firewall().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/apply_to_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var ApplyToResourceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "apply-to-resource FIREWALL FLAGS",
Use: "apply-to-resource <firewall> (--type server --server <server> | --type label_selector --label-selector <label-selector>)",
Short: "Applies a Firewall to a single resource",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.Firewall().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
var CreateCmd = base.CreateCmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "create FLAGS",
Use: "create [options] --name <name>",
Short: "Create a Firewall",
Args: cobra.NoArgs,
}
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/delete_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
var DeleteRuleCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "delete-rule FIREWALL FLAGS",
Use: "delete-rule [options] <firewall> (--direction in --source-ips <ips> | --direction out --destination-ips <ips>) --protocol <icmp|esp|gre|udp|tcp>",
Short: "Delete a single rule to a firewall",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.Firewall().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/remove_from_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var RemoveFromResourceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "remove-from-resource FIREWALL FLAGS",
Use: "remove-from-resource <firewall> (--type server --server <server> | --type label_selector --label-selector <label-selector>)",
Short: "Removes a Firewall from a single resource",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.Firewall().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/firewall/replace_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
var ReplaceRulesCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "replace-rules FIREWALL FLAGS",
Use: "replace-rules <firewall> --rules-file <file>",
Short: "Replaces all rules from a Firewall from a file",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.Firewall().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var AssignCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "assign [FLAGS] FLOATINGIP SERVER",
Use: "assign <floating-ip> <server>",
Short: "Assign a Floating IP to a server",
Args: cobra.ExactArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
var CreateCmd = base.CreateCmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "create FLAGS",
Use: "create [options] --type <ipv4|ipv6> (--home-location <location> | --server <server>)",
Short: "Create a Floating IP",
Args: cobra.NoArgs,
TraverseChildren: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/disable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var DisableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "disable-protection [FLAGS] FLOATINGIP PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "disable-protection <floating-ip> <protection-level>...",
Short: "Disable resource protection for a Floating IP",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/enable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func changeProtection(s state.State, cmd *cobra.Command,
var EnableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "enable-protection [FLAGS] FLOATINGIP PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "enable-protection <floating-ip> <protection-level>...",
Short: "Enable resource protection for a Floating IP",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/floatingip/unassign.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var UnassignCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "unassign [FLAGS] FLOATINGIP",
Use: "unassign <floating-ip>",
Short: "Unassign a Floating IP",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.FloatingIP().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/image/disable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var DisableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "disable-protection [FLAGS] IMAGE PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "disable-protection <image> <protection-level>...",
Short: "Disable resource protection for an image",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/image/enable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var EnableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {

return &cobra.Command{
Use: "enable-protection [FLAGS] IMAGE PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "enable-protection <image> <protection-level>...",
Short: "Enable resource protection for an image",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/add_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var AddServiceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "add-service LOADBALANCER FLAGS",
Use: "add-service [options] <load-balancer> (--protocol http | --protocol tcp --listen-port <1-65535> --destination-port <1-65535> | --protocol https --http-certificates <ids>)",
Short: "Add a service to a Load Balancer",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/add_target.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
var AddTargetCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "add-target LOADBALANCER FLAGS",
Use: "add-target [options] <load-balancer>",
Short: "Add a target to a Load Balancer",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/attach_to_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var AttachToNetworkCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "attach-to-network [FLAGS] LOADBALANCER",
Use: "attach-to-network [--ip <ip>] <load-balancer> --network <network>",
Short: "Attach a Load Balancer to a Network",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/change_algorithm.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var ChangeAlgorithmCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "change-algorithm LOADBALANCER FLAGS",
Use: "change-algorithm <load-balancer> --algorithm-type <round_robin|least_connections>",
Short: "Changes the algorithm of a Load Balancer",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/change_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var ChangeTypeCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "change-type [FLAGS] LOADBALANCER LOADBALANCERTYPE",
Use: "change-type <load-balancer> <load-balancer-type>",
Short: "Change type of a Load Balancer",
Args: cobra.ExactArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var CreateCmd = base.CreateCmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "create [FLAGS]",
Use: "create [options] --name <name> --type <type>",
Short: "Create a Load Balancer",
Args: cobra.NoArgs,
TraverseChildren: true,
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/delete_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var DeleteServiceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "delete-service [FLAGS] LOADBALANCER",
Use: "delete-service <load-balancer> --listen-port <1-65535>",
Short: "Deletes a service from a Load Balancer",
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Args: cobra.RangeArgs(1, 2),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/detach_from_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var DetachFromNetworkCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
cmd := &cobra.Command{
Use: "detach-from-network [FLAGS] LOADBALANCER",
Use: "detach-from-network <load-balancer> --network <network>",
Short: "Detach a Load Balancer from a Network",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/disable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var DisableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "disable-protection [FLAGS] LOADBALANCER PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "disable-protection <load-balancer> <protection-level>...",
Short: "Disable resource protection for a Load Balancer",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/disable_public_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var DisablePublicInterfaceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "disable-public-interface [FLAGS] LOADBALANCER",
Use: "disable-public-interface [options] <load-balancer>",
Short: "Disable the public interface of a Load Balancer",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/enable_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func changeProtection(s state.State, cmd *cobra.Command,
var EnableProtectionCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "enable-protection [FLAGS] LOADBALANCER PROTECTIONLEVEL [PROTECTIONLEVEL...]",
Use: "enable-protection <load-balancer> <protection-level>...",
Short: "Enable resource protection for a Load Balancer",
Args: cobra.MinimumNArgs(2),
ValidArgsFunction: cmpl.SuggestArgs(
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/loadbalancer/enable_public_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
var EnablePublicInterfaceCmd = base.Cmd{
BaseCobraCommand: func(client hcapi2.Client) *cobra.Command {
return &cobra.Command{
Use: "enable-public-interface [FLAGS] LOADBALANCER",
Use: "enable-public-interface <load-balancer>",
Short: "Enable the public interface of a Load Balancer",
Args: cobra.ExactArgs(1),
ValidArgsFunction: cmpl.SuggestArgs(cmpl.SuggestCandidatesF(client.LoadBalancer().Names)),
Expand Down
Loading

0 comments on commit 54faaca

Please sign in to comment.