cabal
cabal copied to clipboard
external commands need to explicitly handle their own name being passed to the executable
Describe the bug
#9412 passes name to the external executable. The use case is a symlink to an executable that handles multiple commands.
I think this use-case doesn't justify the complication this causes for the average case and it isn't strictly necessary to support the use-case.
To Reproduce
- have a command
cabal-blain your environment that doesn't allow to take the argument"bla" - run
cabal bla - should fail with "doesn't expect "bla""
Expected behavior
cabal bla should be equivalent to cabal-bla
To support the intended use case
If you want to have a singular exe handle multiple plugin arguments, just write a wrapper that invokes the particular exe with the argument and symlink the bash wrapper. This behavior should not go at the cost of the average case behavior.
Additional context
The fix should be easy, just don't pass name to the executable here:
https://github.com/haskell/cabal/blob/9b3ce92dc6ce0188066ee5f76f249025cdc9df91/cabal-install/src/Distribution/Client/Main.hs#L383
(@mpickering)