diff options
| author | 2015-11-26 16:00:26 +0000 | |
|---|---|---|
| committer | 2015-11-26 16:00:57 +0000 | |
| commit | 71ece08aad38de2e938d7f378b00ef8360922336 (patch) | |
| tree | 1869f0b14a0e4b80f7cdd3ddf644ca719e23e4ce | |
| parent | 013bcdee35b54fd7be928e8b57e9c659d325fff3 (diff) | |
| download | nnn-71ece08aad38de2e938d7f378b00ef8360922336.tar.gz | |
Add usage
| -rw-r--r-- | noice.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -878,12 +878,22 @@ moretyping: } } +void +usage(char *argv0) +{ + fprintf(stderr, "usage: %s [dir]\n", argv0); + exit(1); +} + int main(int argc, char *argv[]) { char cwd[PATH_MAX], *ipath; char *ifilter; + if (argc > 2) + usage(argv[0]); + /* Confirm we are in a terminal */ if (!isatty(0) || !isatty(1)) { fprintf(stderr, "stdin or stdout is not a tty\n"); |