chiark / gitweb /
Adjust --version output to more closely match GNU standards
[disorder] / server / decode.c
index b609d4e6eab48491f3dd2905878bb65ef310b755..36d98ca5ec06c947bdaa0bfe8d940d967e271499 100644 (file)
@@ -50,6 +50,7 @@
 #include "defs.h"
 #include "wav.h"
 #include "speaker-protocol.h"
 #include "defs.h"
 #include "wav.h"
 #include "speaker-protocol.h"
+#include "version.h"
 
 /** @brief Encoding lookup table type */
 struct decoder {
 
 /** @brief Encoding lookup table type */
 struct decoder {
@@ -444,13 +445,6 @@ static void help(void) {
   exit(0);
 }
 
   exit(0);
 }
 
-/* Display version number and terminate. */
-static void version(void) {
-  xprintf("%s", disorder_version_string);
-  xfclose(stdout);
-  exit(0);
-}
-
 int main(int argc, char **argv) {
   int n;
   const char *e;
 int main(int argc, char **argv) {
   int n;
   const char *e;
@@ -460,7 +454,7 @@ int main(int argc, char **argv) {
   while((n = getopt_long(argc, argv, "hV", options, 0)) >= 0) {
     switch(n) {
     case 'h': help();
   while((n = getopt_long(argc, argv, "hV", options, 0)) >= 0) {
     switch(n) {
     case 'h': help();
-    case 'V': version();
+    case 'V': version("disorder-decode");
     default: fatal(0, "invalid option");
     }
   }
     default: fatal(0, "invalid option");
     }
   }