diff options
author | Martin Müller <mail@mueller-martin.net> | 2017-02-24 05:59:06 +0300 |
---|---|---|
committer | Martin Müller <mail@mueller-martin.net> | 2017-02-24 05:59:06 +0300 |
commit | 1939ea85567a607aff6847607ae9b8a38918d20c (patch) | |
tree | 3cd86e8ab8ef0c2e818426ac068b554f8694a52d | |
parent | 40ccf5e3537ff6b2e5ceac5747f376a2ef430bec (diff) |
Let the program get its name from its arguments
-rw-r--r-- | src/main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -8,6 +8,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <libgen.h> #include "sha1.h" @@ -22,7 +23,7 @@ int main(int argc, char** argv) if (argc < 2) { - printf("Usage: test <file>\n"); + printf("Usage: %s <file>\n", basename(argv[0])); return 1; } |