fish-shell/fish-shell — pull request #970 by nulltrek (2013-08-22 21:09:55+00:00)
Title: Fix "command not found" handler behaviour.

I noticed that typing "--help" on the prompt returns the help message of the command-not-found program instead of the expected message "--help: command not found" (it also works with the other available flags, like --version). This happens because "fish_command_not_found_handler" calls "/usr/lib/command-not-found $argv", so that if $argv contains a valid flag like "--help", it's interpreted as an option by the program. Adding a double hypen before $args prevents the program to evaluate the following arguments as options and passes them literally. (This is the way the command-not-found handle is set in bash and zsh)