Skip to content
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 format --print - results in: '-' is not a recognized option #4896

Closed
racko opened this issue Dec 17, 2023 · 1 comment · Fixed by #4905
Closed

dafny format --print - results in: '-' is not a recognized option #4896

racko opened this issue Dec 17, 2023 · 1 comment · Fixed by #4905
Assignees
Labels
part: documentation Dafny's reference manual, tutorial, and other materials

Comments

@racko
Copy link
Contributor

racko commented Dec 17, 2023

What change in documentation do you suggest?

Currently:

$ dafny --help
...
  format <file>                                    Format the dafny file in-place.
                                                   If no dafny file is provided, will look for every available Dafny file.
                                                   Use '--print -' to output the content of the formatted files instead of overwriting them.

However:

$ dafny format --print - any_file.dfy
*** Error: Command-line argument '-' is neither a recognized option nor a filename with a supported extension (.dfy, .cs, .dll).

Instead,

$ dafny format --print any_file.dfy

yields the desired output.

@racko racko added the part: documentation Dafny's reference manual, tutorial, and other materials label Dec 17, 2023
@racko racko changed the title dafny format: --print - leads to "'-' is not a recognized option" dafny format --print - leads to: '-' is not a recognized option Dec 17, 2023
racko added a commit to racko/dafny that referenced this issue Dec 17, 2023
@racko racko changed the title dafny format --print - leads to: '-' is not a recognized option dafny format --print - results in: '-' is not a recognized option Dec 17, 2023
@MikaelMayer
Copy link
Member

Oh I see it's a documentation issue. It should be "--print" or "--print:true", not "--print -" (that second argument was the one used before @keyboardDrummer added proper options.
Will fix soon. Thanks a lot for reporting and sorry for the trouble. Glad you figured it out by yourself.

MikaelMayer added a commit that referenced this issue Dec 20, 2023
Fixes #4896

Before we released the `format` command with its own set of options, it
was piggy-backing on the Dafny `--print` option which accepted a file
name. We have made it separate since so now that `--print` is always a
bool for the `format` command.

No tests needed because this is documentation

<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part: documentation Dafny's reference manual, tutorial, and other materials
Projects
None yet
2 participants