diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-25 22:40:43 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2013-11-25 22:41:12 -0800 |
commit | b2a08484343f0ae9b50309d3f69eeb0931223f14 (patch) | |
tree | dca1596fa4691b65ba7e2762d55a85207d25a612 /xbacklight.c | |
parent | 4080fb788adba0a851aff29b4dc4f5c71bf4b279 (diff) |
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xbacklight.c')
-rw-r--r-- | xbacklight.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xbacklight.c b/xbacklight.c index 4f384cc..21cca72 100644 --- a/xbacklight.c +++ b/xbacklight.c @@ -19,6 +19,11 @@ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include <stdio.h> #include <stdlib.h> @@ -44,6 +49,7 @@ usage (int exitcode) " where options are:\n" " -display <display> or -d <display>\n" " -help\n" + " -version\n" " -set <percentage> or = <percentage>\n" " -inc <percentage> or + <percentage>\n" " -dec <percentage> or - <percentage>\n" @@ -200,6 +206,11 @@ main (int argc, char **argv) { usage (0); } + if (!strcmp (argv[i], "-version")) + { + puts (PACKAGE_STRING); + exit (0); + } fprintf(stderr, "%s: unrecognized argument '%s'\n", program_name, argv[i]); usage (1); |