Skip to content

chore(cli): convert boolean is_flag options to --flag/--no-flag pairs for consistency #843

Description

@DingmaomaoBJTU

Summary

Several boolean CLI flags use bare is_flag=True (single-direction, e.g. --trust-remote-code) instead of Click's --flag/--no-flag pair pattern. This is inconsistent with newer options like --skip-build/--no-skip-build (added in #659) and makes it harder for users to:

  • Explicitly set a flag to False in scripts/automation
  • Override a config-file default from the CLI
  • Understand the current state from --help output

Flags to convert

The following is_flag=True options should become --xxx/--no-xxx boolean pairs:

Command Current flag Proposed pair
build --use-cache --use-cache/--no-use-cache
build --rebuild --rebuild/--no-rebuild
build --no-quant --quant/--no-quant
build --no-analyze --analyze/--no-analyze
build --no-optimize --optimize/--no-optimize
compile --embed --embed/--no-embed
eval --streaming --streaming/--no-streaming
export --with-report --with-report/--no-with-report
export --clean-onnx --clean-onnx/--no-clean-onnx
export --dynamo --dynamo/--no-dynamo
export --no-hierarchy --hierarchy/--no-hierarchy
inspect --hierarchy --hierarchy/--no-hierarchy
perf --no-quantize --quantize/--no-quantize
perf --rebuild --rebuild/--no-rebuild
perf --ignore-cache --ignore-cache/--no-ignore-cache
perf --monitor --monitor/--no-monitor
quantize --per-channel --per-channel/--no-per-channel
quantize --symmetric --symmetric/--no-symmetric
serve --multi --multi/--no-multi
serve --auto-reload --auto-reload/--no-auto-reload
cli.py --trust-remote-code --trust-remote-code/--no-trust-remote-code
cli.py --allow-unsupported-nodes --allow-unsupported-nodes/--no-allow-unsupported-nodes

Out of scope (action triggers, not toggles): --list, --schema, --list-tasks, --list-capabilities, --list-rewrites, --list-device, --list-ep, --connect, --quiet

Acceptance Criteria

  • All listed flags converted to --flag/--no-flag Click boolean pairs
  • Existing tests updated to reflect new flag names where needed
  • --no-xxx named flags (e.g. --no-quant, --no-analyze) renamed to positive form with negation pair
  • --help output shows both forms and default value
  • No breaking change for users already using the existing --flag form (it remains valid)

Metadata

Metadata

Labels

refactorCode refactoring

Type

No type

Fields

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