mirror of
https://github.com/jarun/nnn.git
synced 2025-01-24 01:36:53 +00:00
Add usage
This commit is contained in:
parent
013bcdee35
commit
71ece08aad
10
noice.c
10
noice.c
|
@ -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…
Reference in a new issue