⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@quentinalbertone
Copy link
Contributor

@quentinalbertone quentinalbertone commented Feb 3, 2026

Description

This Pr allows developers to deprecate flags in the cli

Checklist

(For exoscale contributors)

  • Changelog updated (under Unreleased block)
  • Testing

Testing

type instanceListCmd struct {
	exocmd.CliCommandSettings `cli-cmd:"-"`

	_ bool `cli-cmd:"list"`

	Zone v3.ZoneName `cli-short:"z" cli-usage:"zone to filter results to" cli-deprecated:"use another flag instead"`
}
$> go run github.com/exoscale/cli compute instance list -h
This command lists Compute instances.

Supported output template annotations: .ID, .Name, .Zone, .Type, .IPAddress, .IPv6Address, .State

Usage:
  exo compute instance list [flags]

Aliases:
  list, ls

Flags:
  -h, --help   help for list

Global Flags:
  -C, --config string            Specify an alternate config file [env EXOSCALE_CONFIG]
  -O, --output-format string     Output format (table|json|text), see "exo output --help" for more information
      --output-template string   Template to use if output format is "text"
  -Q, --quiet                    Quiet mode (disable non-essential command output)
  -A, --use-account string       Account to use in config file [env EXOSCALE_ACCOUNT]

$> go run github.com/exoscale/cli compute instance list --zone ch-gva-2
Flag --zone has been deprecated, use another flag instead
[ list of my instance here ]

$> go run github.com/exoscale/cli compute instance list -z ch-gva-2
Flag --zone has been deprecated, use another flag instead

@quentinalbertone quentinalbertone requested a review from a team February 3, 2026 16:34
Copy link
Member

@imiric imiric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Could we also add a test for this in cmd_test.go?

@quentinalbertone
Copy link
Contributor Author

Nice, thanks!

Could we also add a test for this in cmd_test.go?

That's a good point @imiric , I didn't check this file. I will try to add a unit test for this part of the code.

Copy link
Contributor

@kobajagi kobajagi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants