Browse Source

Add usage

master
sin 9 years ago
parent
commit
71ece08aad
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      noice.c

+ 10
- 0
noice.c View File

@@ -878,12 +878,22 @@ moretyping:
} }
} }


void
usage(char *argv0)
{
fprintf(stderr, "usage: %s [dir]\n", argv0);
exit(1);
}

int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
char cwd[PATH_MAX], *ipath; char cwd[PATH_MAX], *ipath;
char *ifilter; char *ifilter;


if (argc > 2)
usage(argv[0]);

/* Confirm we are in a terminal */ /* Confirm we are in a terminal */
if (!isatty(0) || !isatty(1)) { if (!isatty(0) || !isatty(1)) {
fprintf(stderr, "stdin or stdout is not a tty\n"); fprintf(stderr, "stdin or stdout is not a tty\n");


Loading…
Cancel
Save