@@ -295,7 +295,7 @@ static bool parse_options(int argc, char *argv[])
} while (c != EOF && !opt_error);
if (opt_error)
- print_usage(argv[0]);
+ print_usage(basename(argv[0]));
return opt_error;
}
@@ -613,7 +613,7 @@ int main(int argc, char *argv[])
}
if (optind >= argc) {
- print_usage(argv[0]);
+ print_usage(basename(argv[0]));
return 1;
}
@@ -640,13 +640,14 @@ int main(int argc, char *argv[])
}
PR_ERROR("Unsupported command: %s\n", argv[optind]);
- print_usage(argv[0]);
+ print_usage(basename(argv[0]));
return 1;
found_action:
if (rc <= 0) {
printf("No valid targets found or specified. Try adding -p/-c/-t options to specify a target.\n");
- printf("Alternatively run %s -a probe to get a list of all valid targets\n", argv[0]);
+ printf("Alternatively run '%s -a probe' to get a list of all valid targets\n",
+ basename(argv[0]));
rc = 1;
} else
rc = 0;
Instead of outputting: Usage: /root/mikey/pdbg/.libs/pdbg output Usage: pdbg Signed-off-by: Michael Neuling <mikey@neuling.org> --- src/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)