fix(cli): resolve all five HIGH UX issues from CLI audit#73
Merged
Conversation
…s it at parse time
…imitation in --help
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--platformper-argumentcompareexample from README andmigrating-from-dive.md—--platformis a single-value flag and the example implied per-image pinning that doesn't existjqexamples in README that referenced nonexistent snake_case fields (wasted_bytes) — replaced with correct camelCase field paths (efficiency.score,layers[].size,efficiency.wastedFiles[].totalWasted)--jsonfromPersistentFlagsto localFlagsonrootCmdandciCmd;compareCmdnever registers it so passing--json comparenow fails at parse time with "unknown flag" instead of at runtime — addsTestCompareCmd_JSONFlag_UnknownAtParseTimecompleteImageRefsnow callsengineBinaryForCompletion(engineFlag)instead of hardcodingdocker, so Podman users get correct tab completions — addscmd/completion_test.gowarnCIThresholdFlagsIgnoredhelper that scans rawos.Argsand emits awarning:to stderr whenCI=trueis active and a threshold flag name is present; also documents the limitation in the root--helpLongdescriptionNote: HIGH-3 Part B (JSON output on
compare) is a new feature and is deferred to a separate branch. All five HIGH items are marked ✓ DONE ininternal-docs/Revamp_cli.md.Test Plan
go test ./cmd/...— all existing tests pass; new tests:TestCompareCmd_JSONFlag_UnknownAtParseTime,TestCompletionEngineBinary_*,TestCompleteImageRefs_*,TestWarnCIThresholdFlagsIgnored_*layerx compare --json out.json img:a img:b→ "unknown flag: --json" at parse time (not "not supported")layerx --engine podman completion bash— tab completions querypodman imagesinstead ofdocker imagesCI=true layerx --help— Long description mentions threshold flag limitation