Skip to content

Allow omitting the double dash when running cabal run #1119

Open
@23Skidoo

Description

@23Skidoo

As discussed in #1088, cabal run currently requires separating the executable's options from run flags with --:

$ cabal run foo -- -bar baz 
./dist/build/foo/foo -bar baz
$ cabal run foo -bar baz
Unrecognized option: -bar

It would be nice to make the -- optional while still allowing passing options (e.g. --env-var) to run itself. One way to implement this is to treat all input after and including the first unrecognised option as executable's options. However, making this work seems to require modifying both Distribution.Simple.Command and Distribution.GetOpt.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions