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

fish parser should not be special-casing -h and --help (echo -h is broken) #4120

krader1961 opened this issue Jun 14, 2017 · 1 comment
bug Something that's not working as intended


Copy link

krader1961 commented Jun 14, 2017

I've been refactoring the src/builtin.cpp module by hoisting the implementation of each builtin command into its own module. For example, moving builtin_echo() to src/builtin_echo.cpp. This reminded me that the fish parser special-cases -h and --help if they are the only arguments to a command. This is dangerous and in my opinion wrong. For an example of why type echo -h. The -h should be echoed since it isn't a valid flag for that command. What actually happens is you get the echo man page. It also doesn't do the right thing if the user types cmd -h -h, cmd --help -h, etc. unless the actual implementation is correctly parsing the flags and those flags are valid for the command.

@krader1961 krader1961 added the bug Something that's not working as intended label Jun 14, 2017
@krader1961 krader1961 added this to the fish 2.7.0 milestone Jun 14, 2017
@krader1961 krader1961 self-assigned this Jun 14, 2017
Copy link

zanchey commented Jun 16, 2017

I thought we'd explored echo -h in the past, but I can't find an issue. Compliance with other echo implementations is sensible here, so this makes sense to me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
bug Something that's not working as intended
None yet

No branches or pull requests

2 participants