-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Make pony programs exit on an unrecognized pony runtime option #4622
base: main
Are you sure you want to change the base?
Conversation
Hi @dipinhora, The changelog - added label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do. Release notes are added by creating a uniquely named file in the The basic format of the release notes (using markdown) should be:
Thanks. |
As the tests indicate, this will break things. Any program that uses a CLI that starts with |
fair enough.. although the current situation seems like a recipe for disaster where a new pony runtime option might get added that silently takes precedence over an existing option in a pony program.. |
@dipinhora agreed, that is also a problem. I think it is worth a discussion so I am reopening and it can be gone over at the next sync. |
@dipinhora can you rebase this against |
If we decide we want to reserve all of |
When this is rebased against |
Consensus on the sync call is in favor of this @dipinhora. Please proceed. |
Prior to this commit, if someone passed an unrecognized pony runtime option (due to a typo or otherwise), the pony program would silently ignore the argument and keep running without the operator knowing that the intended pony runtime option wasn't applied. ``` root@5babe01f566f:/workspaces/ponyc# ./helloworld --ponyblah Hello, world. root@5babe01f566f:/workspaces/ponyc# ``` This commit changes things so that pony programs will now print out an error message and exit with a non-zero exit code when an unrecognized pony runtime option is supplied: ``` root@5babe01f566f:/workspaces/ponyc# ./helloworld --ponyblah ./helloworld: Unrecognised pony runtime option: '--ponyblah'! Run './helloworld --ponyhelp' for available pony runtime options. root@5babe01f566f:/workspaces/ponyc# ```
rebased..
can you folks please suggest the wording desired? also, i'm not familiar with the |
I looked at the CLI docs and I don't think there is a good place for a note there. Certainly nothing that I can see adding value. I think it is reasonable for us to reconsider. Given that all new usage of flags will result in an error when someone tries to use then perhaps the correct place is part of the error message that Dipin has added here. "If you tried to add a flag starting with --pony ... etc etc". I think that having in that error message rather than tucked away in CLI and Env docs will result in a better experience for anything tripping over And in addition to that, we have the release notes to make the breaking change clear in the case of existing programs that might break. |
Prior to this commit, if someone passed an unrecognized pony runtime option (due to a typo or otherwise), the pony program would silently ignore the argument and keep running without the operator knowing that the intended pony runtime option wasn't applied.
This commit changes things so that pony programs will now print out an error message and exit with a non-zero exit code when an unrecognized pony runtime option is supplied: