microsoft / microsoft/winml-cli
refactor: unify --format option across all commands (inspect, sys) to use shared format_option()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 50
Description
Summary
winml inspect and winml sys have their own inline --format option definitions that predate the shared cli_utils.format_option() decorator introduced in #855. Unify them to use the shared decorator and OutputFormat type alias for consistency.
Commands to update
winml inspect— currently usesclick.Choice(["table", "json"])with default"table"winml sys— currently usesclick.Choice(["text", "json", "compact"])with default"text"
Notes
inspectuses"table"instead of"text"as its non-JSON default — consider whether to rename to"text"for consistency or extendOutputFormatto include"table".syssupports a third format"compact"— the shared decorator may need an optionalextra_choicesparameter, orsyscan keep its own definition if the set of choices differs significantly.- Update type annotations from
strtoOutputFormat(or extended variant).
Related
Follow-up to #855 which introduced the shared format_option() and OutputFormat type.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the shared cli_utils.format_option() decorator and OutputFormat introduced in #855, then compare the existing --format definitions for winml inspect and winml sys. Done means both commands consistently use the shared option and appropriate type annotations, while their table/text, json, and compact choices are intentionally handled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100