Skip to content

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

@DingmaomaoBJTU

Description

@DingmaomaoBJTU

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — minor bug or non-critical improvementfeature scaleFeature scale work itemtriagedIssue has been triaged

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions