From 6ecc3182dab397d7b197e18d7bf78ca8c1316f71 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 1 Aug 2008 22:12:57 -0500 Subject: [PATCH] added a version command line option and variable. --- espeakup.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/espeakup.c b/espeakup.c index 6510425..69ead42 100644 --- a/espeakup.c +++ b/espeakup.c @@ -1,5 +1,5 @@ /* - * espeakup - connector so that speakup can use espeak. + * espeakup - interface which allows speakup to use espeak * * Copyright (C) 2008 William Hubbs * @@ -26,8 +26,11 @@ #include #include +/* program version */ +const char *Version = "0.1"; + /* command line options */ -const char *cliOptions = "d"; +const char *cliOptions = "dV"; /* max buffer size */ const int maxBufferSize = 1025; @@ -261,6 +264,14 @@ void espeakup_sighandler(int sig) exit(0); } +void show_version(void) +{ + printf("espeakup %s\n", Version); + printf("Copyright (C) 2008 William Hubbs\n"); + printf("License GPLv3+: GNU GPL version 3 or later\n"); + printf("You are free to change and redistribute this software.\n"); +} + int main(int argc, char **argv) { struct synth_t s = { @@ -278,9 +289,13 @@ int main(int argc, char **argv) case 'd': debug = 1; break; + case 'V': + show_version(); + exit(0); + break; default: printf("usage: %s [-d]\n", argv[0]); - exit(0); + return 0; break; } }