Skip to content

with build, with test and with analyze silently accept unknown options (check and run refuse them) #2634

Closed

Description

@ehartford

with build, with test and with analyze accept an option they do not know, ignore it, and exit 0. with check and with run refuse the same option. A misspelled or unsupported flag therefore does nothing and says nothing: --emit-llvm writes an executable to the .ll path (#1097), and a test fixture's //! args: line passes without exercising what it asks for (#1048).

CLAUDE.md's route rule already states the contract: "an unknown flag is refused, #2198".

Repro (with v0.15.3.0, main a261b65, macOS arm64)

$ cat main.w
print("hi")
$ with build main.w --no-such-flag-x -o out.bin; echo rc=$?
rc=0                      # out.bin is a Mach-O executable
$ with build --no-such-flag-x main.w -o out2.bin; echo rc=$?
rc=0
$ with test --no-such-flag-x main.w; echo rc=$?
hi
rc=0
$ with analyze --no-such-flag-x main.w; echo rc=$?
analysis-facts	v2	…
rc=0
$ with check main.w --no-such-flag-x; echo rc=$?
error: unknown option `--no-such-flag-x` for `with check`
rc=2
$ with run --no-such-flag-x main.w; echo rc=$?
error: unknown option `--no-such-flag-x` for `with run`
rc=2
$ with build main.w --emit-llvm -o ll.out; file ll.out
ll.out: Mach-O 64-bit executable arm64

(with run main.w --flag forwards arguments after the file to the program, which is expected.)

Expected: every subcommand refuses an unknown option the way check and run do, naming the option and the subcommand.

Found during the 2026-10-25 issue triage (#1048, #1097).

Activity

  1. added
    bug
    on Oct 25, 2026
  2. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): reproduced; the runs are in the body (build, test and analyze accept --no-such-flag-x with rc 0; check and run refuse it with rc 2).

    pre-release: a typo or unsupported flag silently produces the wrong artifact in an ordinary command; refusing unknown options in three subcommands is small, and check/run already show the shape.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdo-before-releasereproduced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions