aboutsummaryrefslogtreecommitdiffstats
path: root/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-13 19:13:33 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2017-04-13 19:13:33 +0530
commit275b42efb0fb09fe91174b16eb085c396ab4e45d (patch)
treeae4e346ba6f0f9c564ea18ac8ee88d3cbe6b6000 /nnn.c
parent372a3a0c80bef525314428396f37692a5c6a5fb9 (diff)
downloadnnn-275b42efb0fb09fe91174b16eb085c396ab4e45d.tar.gz
Prepare for release v1.0
Diffstat (limited to 'nnn.c')
-rw-r--r--nnn.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/nnn.c b/nnn.c
index f676eb3..9c8c060 100644
--- a/nnn.c
+++ b/nnn.c
@@ -53,6 +53,7 @@ xprintf(int fd, const char *fmt, ...)
#define DPRINTF_P(x)
#endif /* DEBUG */
+#define VERSION "v1.0"
#define LEN(x) (sizeof(x) / sizeof(*(x)))
#undef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
@@ -1577,7 +1578,7 @@ nochange:
static void
usage(void)
{
- fprintf(stderr, "usage: nnn [-d] [dir]\n");
+ fprintf(stderr, "usage: nnn [-d] [-v] [dir]\n");
exit(1);
}
@@ -1597,13 +1598,16 @@ main(int argc, char *argv[])
if (argc > 3)
usage();
- while ((opt = getopt(argc, argv, "d")) != -1) {
+ while ((opt = getopt(argc, argv, "dv")) != -1) {
switch (opt) {
case 'd':
/* Open in detail mode, if set */
showdetail = 1;
printptr = &printent_long;
break;
+ case 'v':
+ fprintf(stderr, "%s\n", VERSION);
+ return 0;
default:
usage();
}