-
Notifications
You must be signed in to change notification settings - Fork 263
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
dafny run file.dfy --include file.cs does not raise errors #5097
Comments
+1 |
|
Indeed, but Dafny does not say this, it simply does not include the C# file. Lost a good hour to this. |
How could it detect that you don't mean That would mean we'd have to change how |
Git just does |
Can you provide a concrete example? I'm guessing |
Is the documentation wrong, or did something change? Either way, we documented something untested:
https://dafny.org/latest/DafnyRef/DafnyRef#sec-dafny-run Either way, with this issue raised and my awareness being more acute, my preference would be that any thing not starting with "-" after the file name be recognized as an argument for the main function, and anything starting with "-", if not after a "--", be considered as an option for Dafny and, if not recognized, says something like "If you want to pass this as an argument to the Dafny program, resolve the ambiguity by adding the special argument "--" before it" |
Here is git's behavior:
raises an error (unrecognized flag).
does not. I'd like identical behavior. I think that's what POSIX says? I'm not sure. |
POSIX convention says that I don't think you can follow the POSIX convention and get the behavior you want: that If we want to stay within the convention, the only option I see is to require the user program inputs to be passed using an option, as I described before, so you would have to write Alternatively, we would deviate from the POSIX convention. A small deviation we could do is emit a warning on stderr when you have a |
Fixes #5097 ### Description - Add a warning to dafny run when users are likely to accidentally have mistyped an option name - Enable using `&>` and `&>>` in littish tests ### How has this been tested? - Added a littish test `runArgument.dfy` <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Dafny version
latest-nightly
Code to produce this issue
Command to run and resulting output
What happened?
--include is parsed as an argument to main. It should be detected that it's an option and required that it's after a --
What type of operating system are you experiencing the problem on?
Windows
The text was updated successfully, but these errors were encountered: