microsoft / microsoft/winml-cli

refactor: unify --format option across all commands (inspect, sys) to use shared format_option()

Open
#858 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature scale P2 triaged
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 uses click.Choice(["table", "json"]) with default "table"
  • winml sys — currently uses click.Choice(["text", "json", "compact"]) with default "text"

Notes

  • inspect uses "table" instead of "text" as its non-JSON default — consider whether to rename to "text" for consistency or extend OutputFormat to include "table".
  • sys supports a third format "compact" — the shared decorator may need an optional extra_choices parameter, or sys can keep its own definition if the set of choices differs significantly.
  • Update type annotations from str to OutputFormat (or extended variant).

Related

Follow-up to #855 which introduced the shared format_option() and OutputFormat type.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.