-
Notifications
You must be signed in to change notification settings - Fork 75
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
First mandatory special case #58
Conversation
I'm not sure I like using |
I've also included a type RunArgs =
| [<GatherUnrecognized>] Script of string means that any orphaned token will be parsed to become match parser.Parse([|"script.fsx"|]).GetAllResults() with
| Script path :: rest -> // do stuff |
what happens if you have multiple GatherUnrecognized? It feels somewhat wrong. Can you escape '-' such that we can specify a file named like an argument (yes it's an edge case but what if tools generate the arguments automatically and need an explicit way of telling that this is a script and not an argument)? |
You mean multiple union cases carrying the GatherUnrecognized attribute? It's not allowed and you'll be getting an error at the parser generation stage. I'm not sure I get the second question. |
Ok nice. The second one is about having a file called '--argument' can I make that work with the new attribute? |
Yes, that has worked with any parameter to an argument. As long as '--foo' is not a parameter in the CLI syntax, it can be parsed as a parameter to any switch that takes string. |
Hm maybe that isn't all that important. I think I can live with the suggested solution. My question was about: http://askubuntu.com/questions/482180/unable-to-remove-a-file-which-has-a-name-like-a-command-argument if we have similar things like ' -- '. Additionally on fake I have this argument called --fsiargs which can be followed by any kind of argument (for the fsi). But I can probably force people to use
(That's why I asked for escaping, but now I don't think it's really needed) |
Extracted from #57
I added a special case for a "First" parameter if it is "Mandatory" in that case it can be assigned an empty name (which basically allows it to be used as "first" positional argument).
Ideally we would want to have a "Positional parameter" feature. But this is enough for me now (for FAKE, see fsprojects/FAKE#1281).
But now thinking about it in the special case of FAKE
fake.exe run build.fsx
I could have used an additional parameter inrun
? Would this work the same:?