-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support build script arguments specified using UnionArgParser format #438
Comments
https://github.com/fsharp/FAKE/blob/master/src/app/FAKE/Program.fs#L43 is the only way at the moment. But I'm open for (hopefully backwards compatible) changes, |
OK, I will have a crack at it.
The I could not find documentation for the FAKE command line (bar this). Is there any? If not, I will write that up too. |
Hmmm, did the |
I have found the issue. Someone asked for support for the |
I think it would be good to add all the fsi options. /cc @ctaggart |
…ne can fully specify the command line used by FAKE to invoke FSI. I required this as my build script uses UnionArgParser and there was no way for me to provide arguments to my build script in the format that I wanted. I hope this will be useful in other scenarios (like for those wishing to specify multiple FSI options). * New switch implemented and previous usage left intact. * Command line documentation written for existing switches and new usage. * Add FsiArgs DU for more specific configuration of FSI invocation.
I've had an initial crack at this. Works for me, but would be great if you could have a look and tell me if you like the direction. I tried to add some docs for the command line too, including the new switch I added I had to stop myself from pulling in UnionArgParser and cleaning up the FAKE argument processing code :). |
OK. So I couldn't stop myself. I have a "better" solution for the FAKE cli in general in the works. Still keen to receive feedback on the |
* New CLI for FAKE that uses UnionArgParser. * If new CLI cannot parse, use old CLI for backwards compat. * Strongly typed and easy to read and modify. * Less brittle in face of changes needed for fsprojects#438 etc. * Generates documentation. * Supports combination with app.config settings. * Support long and short switches (e.g. --version or -v). * Support multi-values (e.g. --envVar key value --envVar key value). * Make env flag switches explicit (i.e. --envFlag nameWhoseValWillBeTrue). * Print old and new help.
I've been running my FAKE build scripts directly via FSI, but after recent problems, am switching to using
FAKE.exe
(as I believe this is the right way to do it now). My build script was using UnionArgParser (a very nice arg parsing library) to specify and handle build script arguments. However, I don't think it is possible to make this work viaFAKE.exe
as it does it's own processing of the arguments.From digging around, I'm assuming that one must use the
-d:
prefix on an argument to have it sent to FSI when the build script is executed. However, I would like to be able to send my current argument format (e.g.--config release
) to FSI (as this is what UnionArgParser supports).Is there a way to do this that I'm missing? If not, would you consider a PR that enabled this? I'm open to suggestions, but of the top of my head thought we could detect
--fsiargs
and then pass all args after that to FSI?Update: I see I've misunderstood. The
-d:
arguments are passed as FSI options, rather than as arguments for the.fsx
script. Everything else is set into EnvironmentVariables. Perhaps, a PR that supports an alternative to thearg=x
syntax might work...The text was updated successfully, but these errors were encountered: