diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-23 19:52:23 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2021-09-20 16:05:31 +1200 |
commit | e12dc008646e3991a6ceeecd8f5e0f61179b9925 (patch) | |
tree | 0362965b2bf0b417c5e92b8b1c927fc335ccfb9a | |
parent | Refactor for legibility (diff) | |
download | wtf8-e12dc008646e3991a6ceeecd8f5e0f61179b9925.tar.gz wtf8-e12dc008646e3991a6ceeecd8f5e0f61179b9925.zip |
Add help message for improper usage
-rw-r--r-- | wtf8.c | 4 | ||||
-rw-r--r-- | wtf8.h | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -92,8 +92,10 @@ int main(int argc, char **argv) { /* * Check we have one and only one argument */ - if (argc != 2) + if (argc != 2) { + fprintf(stderr, "%s: Need one argument\n", PROGRAM_NAME); exit(EXIT_FAILURE); + } /* * Print the sole argument first as hex octets, then as characters, spaced @@ -2,6 +2,8 @@ #include <stdio.h> #include <stdlib.h> +#define PROGRAM_NAME "wtf8" + #define BYTE_SEP '-' #define CHAR_SEP ' ' |