Allow omitting the double dash when running `cabal run`
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
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`.
Contributor guide
Research direction
Start by reading Distribution.Simple.Command and Distribution.GetOpt, the two parsing areas named in the issue, and compare how cabal run handles options before and after --. Done means executable options such as -bar and --env-var are correctly distinguished without requiring --, while explicit -- continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100