Introduction
Introduction Statistics Contact Development Disclaimer Help
Add usage - noice - small file browser (mirror / fork from 2f30.org)
git clone git://git.codemadness.org/noice
Log
Files
Refs
README
LICENSE
---
commit 71ece08aad38de2e938d7f378b00ef8360922336
parent 013bcdee35b54fd7be928e8b57e9c659d325fff3
Author: sin <[email protected]>
Date: Thu, 26 Nov 2015 16:00:26 +0000
Add usage
Diffstat:
M noice.c | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/noice.c b/noice.c
@@ -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");
You are viewing proxied material from codemadness.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.