Add executable fall-through#1434
Add executable fall-through#1434borsboom merged 1 commit intocommercialhaskell:masterfrom yamadapc:enhancement/1433-git-style-executable-fallthrough
Conversation
|
Updated to conform to 2 spaces indentation and not run |
There was a problem hiding this comment.
It would be better if this replaces the current process instead of spawning a sub-process and just waiting for it to finish. Stack.Exec.exec will do that, but it's another function that needs an EnvOverride (this time via a Config). It's possible to create an EnvOverride using System.Process.Read.mkEnvOverride, and exec could be modified to take an EnvOverride as an argument instead of needing a Config.
|
It seems like I'd still need a config to know the platform... I made some changes, but couldn't get this to work. |
|
Using Distrubition.System.buildPlatform will suffice for this case.
|
|
Cool, thanks for the tip; I should have asked sooner. Updated and rebased against Not sure if I made the |
|
Thanks, this is looking just about ready for merge. I tested it and everything seems to be in order. Please add an entry to the changelog, and maybe squash it into one commit. |
|
Okie, coolness! Squashed, changelog entry added and rebased against |
This closes #1433. When an invalid `stack` command is issued, `stack` will look in the `PATH` for a matching binary. So given there's an executable `stack-something` in the `PATH`, issuing `stack something` will execute it, rather than failing. It uses `System.Directory.findExecutable` to find executables and `exec` from `System.Process.Read` to execute the process. Adds a mOnFailure callback to be called on parser failures to the `Options.Complicated` parsing function.
…cutable-fallthrough Add executable fall-through
Uses
System.Directory.findExecutable. Adds amOnInvalidArgscallback to thecomplicatedOptionsfunction onOptions.Applicative.Complicatedthe rest ofthe logic is centralized on
Main.I didn't use
System.Process.Read.findExecutablebecause I'd then needgetMinimalEnvOverride, which would requireGlobalOptsI think. I'm not sure,but I don't understand what'd give at the moment.
Will rebase after discussion.
This closes #1433.