Skip to content

Commit

Permalink
Make Command.Synopsis() implementations one line (#14)
Browse files Browse the repository at this point in the history
From mitchellh/cli `Command.Synopsis()` is supposed to output a
single line[0], as the `Command.Help()` is used when requesting
detailed help about a specific command. This corrects all the
existing `Synopsis()` implementations.

This fixes #13.

This change also addresses some formatting inconsistencies:
commands are standardized on ending their Help() synopsis
output with a period, but some were missing.

[0]: https://github.com/mitchellh/cli/blob/v1.1.5/command.go#L28-L30
  • Loading branch information
ggambetti committed Jun 6, 2023
1 parent 884028a commit f0abf3b
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion internal/command/plan_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ Options:
}

func (c *OutputPlanCommand) Synopsis() string {
return c.Help()
return "Returns the plan details for the provided Plan ID"
}
2 changes: 1 addition & 1 deletion internal/command/run_apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,5 @@ Options:
}

func (c *ApplyRunCommand) Synopsis() string {
return c.Help()
return "Applies a run that is paused waiting for confirmation after a plan"
}
2 changes: 1 addition & 1 deletion internal/command/run_cancel.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ Options:
}

func (c *CancelRunCommand) Synopsis() string {
return c.Help()
return "Interrupts a run that is currently planning or applying"
}
4 changes: 2 additions & 2 deletions internal/command/run_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (c *CreateRunCommand) Help() string {
helpText := `
Usage: tfci [global options] run create [options]
Performs a new plan run in Terraform Cloud, using a configuration version and the workspace's current variables
Performs a new plan run in Terraform Cloud, using a configuration version and the workspace's current variables.
Global Options:
Expand All @@ -157,5 +157,5 @@ Options:
}

func (c *CreateRunCommand) Synopsis() string {
return c.Help()
return "Performs a new plan run in Terraform Cloud, using a configuration version and the workspace's current variables"
}
2 changes: 1 addition & 1 deletion internal/command/run_discard.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@ Options:
}

func (c *DiscardRunCommand) Synopsis() string {
return c.Help()
return "Skips any remaining work on runs that are paused waiting for confirmation or priority"
}
2 changes: 1 addition & 1 deletion internal/command/run_show.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,5 @@ Options:
}

func (c *ShowRunCommand) Synopsis() string {
return c.Help()
return "Returns run details for the provided Terraform Cloud run ID"
}
4 changes: 2 additions & 2 deletions internal/command/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (c *UploadConfigurationCommand) Help() string {
helpText := `
Usage: tfci [global options] upload [options]
Creates and uploads a new configuration version for the provided workspace
Creates and uploads a new configuration version for the provided workspace.
Global Options:
Expand All @@ -109,5 +109,5 @@ Options:
}

func (c *UploadConfigurationCommand) Synopsis() string {
return c.Help()
return "Creates and uploads a new configuration version for the provided workspace"
}

0 comments on commit f0abf3b

Please sign in to comment.