Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --format to subcommands #227

Closed
michaeltlombardi opened this issue Oct 10, 2023 · 1 comment
Closed

Add --format to subcommands #227

michaeltlombardi opened this issue Oct 10, 2023 · 1 comment
Assignees
Labels
Issue-Enhancement The issue is a feature or idea Resolution-Fixed The issue is fixed

Comments

@michaeltlombardi
Copy link
Collaborator

Summary of the new feature / enhancement

Currently, to define a format for the output, a user needs to add the --format / -f option after the root command and before any subcommands, like:

dsc --format pretty-json resource test -r Microsoft/OSInfo -i '{ "bitness": "64" }'

We should make it possible for users to define the format option on the subcommands as well or instead, so they follow a semantic of selecting the command to use, then supplying options for it:

dsc resource test -r Microsoft/OSInfo -i '{ "bitness": "64" }' -f pretty-json

Note

Additionally, --format doesn't apply to the dsc completer command.

Proposed technical implementation details (optional)

  1. Define --format as a reusable option and add it to the final-leaf subcommands where it applies. For example, the option should be added to dsc config set but not dsc config.
  2. (Optional) Remove the global option, or make dsc completer error when the global option is specified.
@SteveL-MSFT
Copy link
Member

Discussed in WG and agreed on this change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement The issue is a feature or idea Resolution-Fixed The issue is fixed
Projects
None yet
Development

No branches or pull requests

3 participants