Fix mis-modelled multi-arg options: text, data and file utility specs - #343
Conversation
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: wilson.
|
|
This PR was generated with Warp. Comment |
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: wilson.
|
There was a problem hiding this comment.
Per Andy's request, here is per-hunk reasoning inline: why each change is right and the evidence that settles it. This annotates my own work, so it is a comment review rather than a verdict.
Two things I verified and deliberately left alone can't take an inline comment, because their files aren't in this diff:
jq --arg,--argjson,--slurpfile,--rawfile(command-signatures/json/jq.json) — genuinely two-valued, so untouched. jq 1.7--help:--arg name value,--argjson name value,--slurpfile name file,--rawfile name file.sqlite3 -lookaside,-pagecache(command-signatures/json/sqlite3.json) — likewise. SQLite 3.45.1sqlite3 -help:-lookaside SIZE N use N entries of SZ bytes for lookaside memoryand-pagecache SIZE N use N slots of SZ bytes each for page cache memory.
dog --color is ten copies of a single mistake, so the reasoning is written once on the first copy and the other nine point at it rather than repeating it.
Responding as wilson: Open session · View in factory
| } | ||
| ] | ||
| "args": { | ||
| "name": "FLAGS", |
There was a problem hiding this comment.
rsync's own help spells this --info=FLAGS — one value, not fifteen. rsync --info=help prefaces its list with "Use OPT or OPT1 for level 1 output, OPT2 for level 2, etc.; OPT0 silences", so the names are items inside one comma-separated token such as NAME2,STATS3,FLIST0; they were never separate argv words. Confirmed by running it — rsync -a --info=NAME STATS rsrc/ rdst2/ fails with link_stat "/tmp/STATS" failed, because rsync reads STATS as a source path.
NONREG is new here: --info=help lists it and the spec didn't have it.
| } | ||
| ] | ||
| "args": { | ||
| "name": "FLAGS", |
There was a problem hiding this comment.
Same FLAGS shape as --info, but there is a second defect here that the diff cannot show: the fifteen removed args were a verbatim copy of the --info list, down to the ALL/NONE descriptions reading "--info options". Not one of --debug's own flags was present, so the old entry offered the wrong vocabulary entirely.
The suggestions now come from rsync --debug=help: 24 real flags (ACL, BIND, CHDIR, DELTASUM, DUP, GENR, HASH, HLINK, ICONV, NSTR, PROTO, RECV, SEND …) plus ALL/NONE/HELP, with that command's descriptions verbatim.
| } | ||
| ] | ||
| "args": { | ||
| "name": "NUM+SUFFIX", |
There was a problem hiding this comment.
rg --help spells this --dfa-size-limit=NUM+SUFFIX? — the suffix belongs to the same token, so NUM and suffix were never two values. The help block continues: "The input format accepts suffixes of K, M or G … If no suffix is provided the input is treated as bytes", which is what the new description records.
| } | ||
| ] | ||
| "args": { | ||
| "name": "NUM+SUFFIX", |
There was a problem hiding this comment.
--max-filesize=NUM+SUFFIX?, and its help block ends "Examples: --max-filesize 50K or --max-filesize 80M" — one token each. This is the flag I used to prove the shape for all three: rg --max-filesize 50 K hello rgtest/ exits 2 with rg: hello: No such file or directory, because ripgrep took K as the pattern and hello as a path.
| } | ||
| ] | ||
| "args": { | ||
| "name": "NUM+SUFFIX", |
There was a problem hiding this comment.
--regex-size-limit=NUM+SUFFIX? in rg --help, the same single-token format as the two size limits above and collapsed for the same reason. The K/M/G wording is kept in the description so the format is discoverable from the completion menu itself.
| } | ||
| ] | ||
| "args": { | ||
| "name": "WHEN", |
There was a problem hiding this comment.
dog NS --color: copy of the same mistake, same fix — reasoning on the root --color hunk earlier in this review.
| } | ||
| ] | ||
| "args": { | ||
| "name": "WHEN", |
There was a problem hiding this comment.
dog SOA --color: copy of the same mistake, same fix — reasoning on the root --color hunk earlier in this review.
| } | ||
| ] | ||
| "args": { | ||
| "name": "WHEN", |
There was a problem hiding this comment.
dog TTL --color: copy of the same mistake, same fix — reasoning on the root --color hunk earlier in this review.
| } | ||
| ] | ||
| "args": { | ||
| "name": "WHEN", |
There was a problem hiding this comment.
dog ANY +noall +answer --color: copy of the same mistake, same fix — reasoning on the root --color hunk earlier in this review.
| } | ||
| ] | ||
| "args": { | ||
| "name": "WHEN", |
There was a problem hiding this comment.
dog +nocomments … --color: copy of the same mistake, same fix — reasoning on the root --color hunk earlier in this review.
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
|
@cla-bot check |
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: wilson.
|
|
The cla-bot has been summoned, and re-checked this pull request! |
There was a problem hiding this comment.
Overview
This PR updates static command-signature JSON specs to collapse mis-modeled multi-argument options into the single tokens those CLIs actually accept, replace copied positional operands with scoped option arguments or suggestions, and remove an invalid unzip -0 entry.
Concerns
- None. I found no correctness, security, comment-quality, test-quality, or spec-alignment issues in the annotated diff. No approved or repository spec context was provided for additional implementation comparison.
Verdict
Found: 0 critical, 0 important, 0 suggestions
Approve
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
|
@cla-bot check |
|
Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: wilson.
|
|
The cla-bot has been summoned, and re-checked this pull request! |
Follow-up to #341. Options that declare two or more args hit a completer bug where the last declared argument is resolved regardless of which value is being typed, so these were breaking completion, not just describing the tools wrongly. - rsync --info/--debug: fifteen args -> one comma-separated FLAGS argument with the flag names as suggestions. --debug was carrying a copy of the --info flag list; replaced with the real one from rsync --debug=help. --info gained the missing NONREG. - rg --dfa-size-limit/--max-filesize/--regex-size-limit: [NUM, suffix] -> one NUM+SUFFIX token. - pandoc -M/--metadata and -V/--variable: [key, value] -> one KEY[:VALUE] token. - vim -V: [N, fname] -> one optional [N][fname] token fused to the flag. - date -f: dropped new_date, which is date's own operand. - dog --color (ten copies): dropped dog's own positional; WHEN now carries always/automatic/never as suggestions. - unzip -0: dropped unzip's own file operand; one CHARSET argument. jq --arg/--argjson/--slurpfile/--rawfile and sqlite3 -lookaside/-pagecache were verified as genuinely two-valued and left unchanged.
Info-ZIP UnZip 6.00 has no -0: "unzip -0 t.zip" exits 10 and prints usage, and "unzip -h" documents -O CHARSET with no -0 anywhere. The previous commit fixed only the entry's arity and kept it, which made an invalid spelling more prominent - a well-formed CHARSET argument on a flag that does not exist invites more trust than the broken version did. Removing the entry does not settle what the correct spelling is. -O and -I come from the Debian charset patch and are absent from stock Info-ZIP on macOS, so adding -O is a platform decision outside this audit's class of error, and deleting the digit-zero entry does not require answering it.
4ddfde7 to
c6505a5
Compare



What
Follow-up to #341 (
ln -s/-F/-f/-i), covering the text, data and file utilities:jq,rg,rsync,pandoc,sqlite3,unzip,vim,date,dog.An option that declares two or more
argshits a completer bug where the lastdeclared argument is resolved no matter which value you are typing, so a
mis-modelled option actively breaks completion rather than just describing the
tool wrongly. This PR corrects the spec data for the options in that group that
were modelling one value (or a value set, or the command's own operands) as
several arguments.
Every option below was checked against the tool's own ground truth before it was
touched. Where the tool is installed here it was run; otherwise the official
documentation is named. Nothing was changed on the basis of how the argument
names in our spec read.
Changed
rsync --info/--debug— a value set enumerated as argsBoth declared fifteen arguments (
BACKUP,COPY,DEL,FLIST, …). Bothtake a single comma-separated
FLAGStoken.Evidence (rsync 3.2.7,
rsync --help):rsync --info=helpprefaces its list with "Use OPT or OPT1 for level 1 output,OPT2 for level 2, etc.; OPT0 silences." Confirmed empirically — a second token
is consumed as a source path, not as a flag:
Now one
FLAGSargument carrying the flag names as suggestions. Two correctionscame with it, both from the tool:
--debugwas carrying a verbatim copy of the--infoflag list. Replacedwith the real one from
rsync --debug=help(ACL,BACKUP,BIND,CHDIR,CONNECT,CMD,DEL,DELTASUM,DUP,EXIT,FILTER,FLIST,FUZZY,GENR,HASH,HLINK,ICONV,IO,NSTR,OWN,PROTO,RECV,SEND,TIME, plusALL/NONE/HELP), and itsALL/NONEdescriptions now say"--debug options" rather than "--info options".
--infogainedNONREG, which is inrsync --info=helpand was missing.Suggestion descriptions are
--info=help/--debug=helptext verbatim.rg --dfa-size-limit/--max-filesize/--regex-size-limit— one value modelled as twoEach declared
[NUM, suffix]. The suffix is part of one token.Evidence (ripgrep 14.1.0,
rg --help):--dfa-size-limit=NUM+SUFFIX?and--regex-size-limit=NUM+SUFFIX?carry thesame wording. Confirmed empirically:
Collapsed to a single
NUM+SUFFIXargument, with the format documented in theargument description.
pandoc -M/--metadataand-V/--variable— one value modelled as twoEach declared
[key, value]. Both take a single colon-joined token.Evidence (pandoc 3.1.3,
pandoc --help):Confirmed empirically:
Collapsed to a single
KEY[:VALUE]argument.vim -V— one value modelled as two (fused token)Declared
[N, fname]. Real syntax attaches both parts to the flag itself, sothere is no separate value token at all.
Evidence (Vim 9.1,
vim --help):Confirmed empirically — fused writes the log, separated does not:
Collapsed to one optional
[N][fname]argument, consistent with how this specalready models
-p[N],-o[N]and-O[N].date -f— operands written into the optionDeclared
[input_fmt, new_date].-fconsumes onlyinput_fmt;new_dateisdate's own operand, already modelled by the spec's top-levelnew_time OR output_fmtargument. This is exactly theln -sshape.This spec models BSD/macOS
date(-j,-R,-v,-t), which is not thedateinstalled here, so ground truth is the official FreeBSDdate(1)manpage (FreeBSD 14.0-RELEASE):
new_dateremoved from the option.dog --color(ten copies) — operands written into the optionDeclared
[arguments, WHEN], whereargumentsis a verbatim copy ofdog's owntop-level positional — same name and same description ("Human-readable host
names, nameservers, types, or classes"). The ten occurrences are ten independent
copies in
dog.json(root plus nine subcommand paths:A,MX,CNAME,TXT,NS,SOA,TTL,ANY +noall +answer, and the+nocomments …path), not oneshared definition; all ten are fixed identically.
The
dogbinary shipped for Linux (v0.1.0) will not run here (it linkslibssl.so.1.1), so ground truth is the man page shipped in the same releasearchive:
Corroborated by dog's own shipped fish completion, which offers exactly
always/automatic/neverfor the flag.argumentsremoved; the remainingWHENargument now carries those threevalues as suggestions, matching how
ls --coloris already modelled in thisrepo.
unzip -0— deleted; the option does not existDeclared
[gbk, file], wherefileisunzip's own operand (unzip [-opts] file[.zip] [list]) andgbkis a charset value rather than an argument name.But the flag itself is not real: Info-ZIP UnZip 6.00 has no
-0at all.The entry is almost certainly a digit-zero/letter-O mix-up for
-O CHARSET. Anearlier revision of this PR fixed only the arity and kept the entry, which was
the wrong call: a well-formed
CHARSETargument on a flag that does not existinvites more trust than the broken version did. The entry is now removed.
Removing it deliberately does not settle what the correct spelling is.
-Oand-Icome from the Debian charset patch and are absent from stock Info-ZIP onmacOS, so adding
-Ois a platform decision outside this audit's class oferror — and deleting the digit-zero entry does not require answering it. See
"Flagged" below.
Verified correct, left alone
jq --arg,--argjson,--slurpfile,--rawfile— genuinely two-valued.jq 1.7
jq --help:sqlite3 -lookaside,-pagecache— genuinely two-valued. SQLite 3.45.1sqlite3 -help:Flagged, not changed
unziphas no charset option after this PR. The deleted-0entry was thespec's only attempt at one. Adding the real
-O CHARSET(and its sibling-I CHARSET) is the open follow-up, and it needs a platform decision first:both come from the Debian charset patch and are absent from stock Info-ZIP on
macOS, so a spec that offers them unconditionally would suggest flags that do
not exist for macOS users.
rsync --info/--debugcarry"requiresSeparator": true, which is a Figfield name; this repo's
CommandOptiontype readsrequiresEquals, so thefield is silently ignored on deserialize. Pre-existing, unrelated to arity,
left as-is.
Unresolved
None. Every option in the assigned group was settled against the tool's own help
output, its shipped man page, or the official man page named above.
Testing
cargo test -p warp-command-signatures— 176 passed, 0 failed.npm run format:check— all matched files use Prettier code style.