haskell / haskell/cabal

better error reporting for `cabal v2-run -- --opts`

Open
#6,074 9 comments 0 reactions 0 assignees View on GitHub
attention: pr-welcome cabal-install: cmd/run re: error-message type: enhancement
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When I run
```
cabal new-run
```
it (usually) picks a sensible target to run. But then I want to pass arguments, like
```
cabal new-run -- --help
```
and I get
```
$ cabal new-run -- --help
cabal: Unknown target '--help'.
There is no component '--help'.
The project has no package '--help'
```
I see how that can be justified if `--` means “treat the rest as non-option arguments”, but I find “pass the rest to the called function” more usefull.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported `cabal new-run -- --help` behavior and compare it with the intended `cabal v2-run -- --opts` syntax. Trace the command-line handling for `--` and verify that arguments after it reach the selected target instead of being treated as Cabal targets; done means the example no longer reports `Unknown target '--help'`.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.