diff options
author | Jon Lund Steffensen <jonlst@gmail.com> | 2011-07-04 15:00:46 +0200 |
---|---|---|
committer | Jon Lund Steffensen <jonlst@gmail.com> | 2011-07-04 15:00:46 +0200 |
commit | 3832a2fc7da04510965beae4d996560d7530610d (patch) | |
tree | 21dcf2ace05c100f851f430b399f021696d98d47 | |
parent | Import translations from launchpad. (diff) | |
download | redshift-ng-3832a2fc7da04510965beae4d996560d7530610d.tar.gz redshift-ng-3832a2fc7da04510965beae4d996560d7530610d.tar.bz2 redshift-ng-3832a2fc7da04510965beae4d996560d7530610d.tar.xz |
Add option to show program version (-V).
-rw-r--r-- | redshift.1 | 3 | ||||
-rw-r--r-- | src/redshift.c | 11 |
2 files changed, 11 insertions, 3 deletions
@@ -23,6 +23,9 @@ Display this help message \fB\-v\fR Verbose output .TP +\fB\-V\fR +Show program version +.TP \fB\-c\fR FILE Load settings from specified configuration file .TP diff --git a/src/redshift.c b/src/redshift.c index af154b8..4d5479a 100644 --- a/src/redshift.c +++ b/src/redshift.c @@ -305,8 +305,9 @@ print_help(const char *program_name) /* TRANSLATORS: help output 3 no-wrap */ fputs(_(" -h\t\tDisplay this help message\n" - " -v\t\tVerbose output\n"), stdout); - fputs("\n", stdout); + " -v\t\tVerbose output\n" + " -V\t\tShow program version\n"), stdout); + fputs("\n", stdout); /* TRANSLATORS: help output 4 `list' must not be translated @@ -631,7 +632,7 @@ main(int argc, char *argv[]) /* Parse command line arguments. */ int opt; - while ((opt = getopt(argc, argv, "b:c:g:hl:m:oO:rt:vx")) != -1) { + while ((opt = getopt(argc, argv, "b:c:g:hl:m:oO:rt:vVx")) != -1) { switch (opt) { case 'b': brightness = atof(optarg); @@ -755,6 +756,10 @@ main(int argc, char *argv[]) case 'v': verbose = 1; break; + case 'V': + printf("%s\n", PACKAGE_STRING); + exit(EXIT_SUCCESS); + break; case 'x': mode = PROGRAM_MODE_RESET; break; |