diff --git a/CHANGELOG.md b/CHANGELOG.md index b498f6ff2..22c9f3e42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ ### Enhancements: +- docs(compute): for `compute deploy` and `compute publish`, the `--version` help now says that the flag is optional and + defaults to the active version, or to the latest version if none is active. + ### Dependencies: - build(deps): `github.com/andybalholm/brotli` from 1.2.3 to 1.2.4 ([#1913](https://github.com/fastly/cli/pull/1913)) - build(deps): `github.com/mattn/go-runewidth` from 0.0.29 to 0.0.30 ([#1913](https://github.com/fastly/cli/pull/1913)) diff --git a/pkg/argparser/common.go b/pkg/argparser/common.go index 5b84d2fee..082704f28 100644 --- a/pkg/argparser/common.go +++ b/pkg/argparser/common.go @@ -29,6 +29,10 @@ var ( FlagVersionName = "version" // FlagVersionDesc is the flag description. FlagVersionDesc = "'latest', 'active', 'staged', or the number of a specific Fastly service version" + // FlagVersionOptionalDesc is the flag description for commands where the + // version flag is optional. It describes what OptionalServiceVersion.Parse + // does when the flag is omitted. + FlagVersionOptionalDesc = FlagVersionDesc + " (default: the active version, or the latest version if none is active)" ) // PaginationDirection is a list of directions the page results can be displayed. diff --git a/pkg/commands/compute/deploy.go b/pkg/commands/compute/deploy.go index c287ebc2c..6cc86eacf 100644 --- a/pkg/commands/compute/deploy.go +++ b/pkg/commands/compute/deploy.go @@ -83,7 +83,7 @@ func NewDeployCommand(parent argparser.Registerer, g *global.Data) *DeployComman }) c.RegisterFlag(argparser.StringFlagOpts{ Action: c.ServiceVersion.Set, - Description: argparser.FlagVersionDesc, + Description: argparser.FlagVersionOptionalDesc, Dst: &c.ServiceVersion.Value, Name: argparser.FlagVersionName, }) diff --git a/pkg/commands/compute/publish.go b/pkg/commands/compute/publish.go index 86339f634..b4b0affac 100644 --- a/pkg/commands/compute/publish.go +++ b/pkg/commands/compute/publish.go @@ -81,7 +81,7 @@ func NewPublishCommand(parent argparser.Registerer, g *global.Data, build *Build c.CmdClause.Flag("status-check-timeout", "Set a timeout (in seconds) for the service availability check").Default("120").IntVar(&c.statusCheckTimeout) c.RegisterFlag(argparser.StringFlagOpts{ Name: argparser.FlagVersionName, - Description: argparser.FlagVersionDesc, + Description: argparser.FlagVersionOptionalDesc, Dst: &c.serviceVersion.Value, Action: c.serviceVersion.Set, })