Skip to content

Improve/implement deprecation strategies for commands, command groups, options, parameters #5968

@tjprescott

Description

@tjprescott

Currently we have a couple strategies for deprecating things in the CLI:

commands - deprecation message
parameters - argparse.SUPPRESS allows them to not show up but still be usable.
options - no mechanism
command groups - no mechanism, though you can have deprecation messages for each command in the group

Ideally, there should be mechanism to deprecate any and all of these things that has the following properties:

  1. displays a message if the deprecated thing is used
  2. allows the deprecated thing to be hidden from help but still be usable
  3. allows the dev to specify an expiration date, after which it is as though the thing didn't exist (using it will cause the regular error). A command table linter rule can be used to identify deprecated items which have passed their "expiration date" and thus can be removed.

Environment summary

Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (az --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

azure-cli (2.0.30)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions