projects
/
dus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the -v option to print the version number.
[dus.git]
/
dus.c
diff --git
a/dus.c
b/dus.c
index
5f481d7
..
4acc517
100644
(file)
--- a/
dus.c
+++ b/
dus.c
@@
-394,6
+394,7
@@
void usage(FILE *out) {
/**********************************************************************/
static struct option long_options[] = {
/**********************************************************************/
static struct option long_options[] = {
+ { "version", no_argument, 0, 'v' },
{ "ignore-dots", no_argument, 0, 'd' },
{ "reverse-order", no_argument, 0, 'r' },
{ "show-top", no_argument, 0, 't' },
{ "ignore-dots", no_argument, 0, 'd' },
{ "reverse-order", no_argument, 0, 'r' },
{ "show-top", no_argument, 0, 't' },
@@
-414,10
+415,15
@@
int main(int argc, char **argv) {
setlocale (LC_ALL, "");
setlocale (LC_ALL, "");
- while ((c = getopt_long(argc, argv, "dfrtl:c:m:hd",
+ while ((c = getopt_long(argc, argv, "
v
dfrtl:c:m:hd",
long_options, NULL)) != -1) {
switch (c) {
long_options, NULL)) != -1) {
switch (c) {
+ case 'v':
+ printf("dus version %s (%s)\n", VERSION_NUMBER, UNAME);
+ exit(EXIT_SUCCESS);
+ break;
+
case 'd':
ignore_dotfiles = 1;
break;
case 'd':
ignore_dotfiles = 1;
break;