diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-23 19:52:23 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-12-23 19:52:23 +1300 |
commit | 927560e25d6424ef134c85138b08a96e847d2841 (patch) | |
tree | 0362965b2bf0b417c5e92b8b1c927fc335ccfb9a | |
parent | Refactor for legibility (diff) | |
download | wtf8-927560e25d6424ef134c85138b08a96e847d2841.tar.gz wtf8-927560e25d6424ef134c85138b08a96e847d2841.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 ' ' |