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

Comments

Projects
None yet
2 participants
@krader1961
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 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

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Jun 16, 2017

Member

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment