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

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

Comments

@krader1961
Copy link
Contributor

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
@zanchey
Copy link
Member

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.
Labels
bug Something that's not working as intended
Projects
None yet
Development

No branches or pull requests

2 participants