Show how fish was executed, using argv[0] for program_name

... rather than hard code it to "fish". This affects
what is found in $_ and improves the errors:

For example, if fish was ran with ./fish, instead of
something like:

  fish: Expected 3 surprises, only got 2 surprises

we'll see:

 ./fish: Expected 3 surprises, only got 2 surprises

like most other shell utilities. It's just a tiny bit
of detail that can avoid confusion.
This commit is contained in:
Aaron Gyes
2018-11-25 16:06:39 -08:00
parent 85cecd30fb
commit 1cb8b2a87b
11 changed files with 24 additions and 24 deletions

View File

@@ -383,7 +383,7 @@ static bool parse_flags(int argc, char **argv, bool *continuous_mode) {
}
int main(int argc, char **argv) {
program_name = L"fish_key_reader";
program_name = argv[0];
bool continuous_mode = false;
if (!parse_flags(argc, argv, &continuous_mode)) return 1;