fix: reject conflicting qcoffee source modes - #37
Merged
tiye merged 2 commits intoAug 23, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens qcoffee CLI argument validation to reject conflicting/duplicate “source input” and “execution mode” combinations (closing a -e ... --check FILE overwrite loophole), and updates the RFCs/manuals/docs plus regression tests to match the clarified contract.
Changes:
- Enforce mutual exclusivity between
-e/positional/STDIN source inputs and--check/--dump-bytecode/--fingerprint/--statsexecution modes, and reject repeated mode flags. - Add CLI regression tests for
-e+--checkconflicts and repeated--dump-bytecode. - Synchronize the CLI contract text across RFC 0027 / RFC 0080 and all rendered manuals (qc/md/html).
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/cli_tools.rs | Adds regression coverage for conflicting source/mode inputs and repeated execution modes. |
| src/main.rs | Implements stricter CLI parsing to reject conflicting source inputs and repeated mode flags. |
| RFCs/0080-cli-bytecode-fingerprint.md | Updates fingerprint mode contract to explicitly require a single source input and mutual exclusion. |
| RFCs/0027-cli-check-mode.md | Clarifies check mode cannot be combined with -e/script path/other source inputs. |
| manuals/manual.zh-CN.qc | Updates manual text to state single source input + conflicting mode rejection. |
| manuals/manual.latin.qc | Same contract clarification (Latin manual). |
| manuals/manual.en.qc | Same contract clarification (English manual). |
| manuals/manual.devanagari-sa.qc | Same contract clarification (Sanskrit/Devanagari manual). |
| manuals/manual.classical-zh.qc | Same contract clarification (Classical Chinese manual). |
| docs/manual.zh-CN.md | Updates rendered Markdown manual to reflect new CLI constraints. |
| docs/manual.zh-CN.html | Updates rendered HTML manual to reflect new CLI constraints. |
| docs/manual.latin.md | Updates rendered Markdown manual to reflect new CLI constraints. |
| docs/manual.latin.html | Updates rendered HTML manual to reflect new CLI constraints. |
| docs/manual.en.md | Updates rendered Markdown manual to reflect new CLI constraints. |
| docs/manual.en.html | Updates rendered HTML manual to reflect new CLI constraints. |
| docs/manual.devanagari.sa.md | Updates rendered Markdown manual to reflect new CLI constraints. |
| docs/manual.devanagari-sa.html | Updates rendered HTML manual to reflect new CLI constraints. |
| docs/manual.classical-zh.md | Updates rendered Markdown manual to reflect new CLI constraints. |
| docs/manual.classical-zh.html | Updates rendered HTML manual to reflect new CLI constraints. |
Suppressed comments (1)
src/main.rs:161
--checkaccepts a following flag (e.g.qcoffee --check --stats) as the FILE argument and then fails with a read error (exit 1) instead of a usage error (exit 2). This is inconsistent with--dump-bytecode/--fingerprintarg validation and contradicts the documented “usage error on missing/invalid file parameter” behavior.
if source.is_some() || dump || check || fingerprint || stats {
eprintln!(
"--check, --dump-bytecode, --fingerprint, and --stats are execution-mode alternatives"
);
return ExitCode::from(2);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tiye
force-pushed
the
fix/qtest-global-order
branch
from
August 23, 2026 04:39
5899cc9 to
c23925b
Compare
Base automatically changed from
fix/qtest-global-order
to
feat/program-fingerprint
August 23, 2026 04:40
tiye
force-pushed
the
fix/qcoffee-source-mode-conflicts
branch
from
August 23, 2026 04:43
ee6c8c9 to
691109f
Compare
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
-e ... --check FILEoverwrite loopholeValidation
make checkmake docsgit diff --checkThis PR is chained after PR #36 and is intentionally not merged automatically.