Skip to content

Mispelled flags are mistaken with file names #1505

Open
@cg-jl

Description

When mispelling a flag to the compiler, it mistakes it with a file name, which generates a somewhat confusing error message:

$ jakt --cxx-compile-path /opt/bin/clang++-16 test.jakt
Extra unknown argument '/opt/bin/clang++-16', you can only pass one source file (was '--cxx-compile-path')
usage: jakt [cross] [-h] [OPTIONS] <filename>

Perhaps we should assume anything starting with - is an option, so that jakt can complain about non-existing options.
To keep supporting file names that may start with -, we could make use of a marker like -- to signal that flag-like arguments end, so that the next argument is interpreted as a file name, disregarding the - from the start.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions