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.
The text was updated successfully, but these errors were encountered:
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.
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 typeecho -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 typescmd -h -h
,cmd --help -h
, etc. unless the actual implementation is correctly parsing the flags and those flags are valid for the command.The text was updated successfully, but these errors were encountered: