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

Using incorrect/invalid types for CLI flags raises no warnings to user and is passed through as-is, which can result in unexpected behavior #1598

Open
peterbe opened this issue Oct 7, 2021 · 1 comment

Comments

@peterbe
Copy link

peterbe commented Oct 7, 2021

Originally posted by @rschristian in #1596 (comment)

Typing preact watch -p XXXX just goes ahead and starts on the default port (8080).
It should error because XXXX is not a number.

@rschristian
Copy link
Member

rschristian commented Oct 7, 2021

To expound a bit: most args don't have any type validation and rely upon fallbacks or (sometimes) questionable coercion deep into the tool. Warnings aren't raised to the user on such occasions and our assumptions about types can sometimes be faulty (see #1595).

Just wanted to clarify that this isn't just an issue with the port, but many of our arguments. They should all get the same treatment (eventually).

@rschristian rschristian changed the title Use --port=notanumber doesn't fail Using incorrect/invalid types for CLI flags raises no warnings to user and is passed through as-is, which can result in unexpected behavior Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants