X-Git-Url: https://git.distorted.org.uk/~mdw/disorder/blobdiff_plain/f15929695c1154fc9959e66ecb1d4aad1558fe0a..08874c0649d7377f09c698bc84b885dd3b62b217:/clients/disorder.c diff --git a/clients/disorder.c b/clients/disorder.c index 2d3cb9f..fa42558 100644 --- a/clients/disorder.c +++ b/clients/disorder.c @@ -1,6 +1,6 @@ /* * This file is part of DisOrder. - * Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell + * Copyright (C) 2004-2008 Richard Kettlewell * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -53,6 +53,7 @@ #include "defs.h" #include "authorize.h" #include "vector.h" +#include "version.h" static disorder_client *client; @@ -84,13 +85,6 @@ static void help(void) { exit(0); } -/* display version number and terminate */ -static void version(void) { - xprintf("%s", disorder_version_string); - xfclose(stdout); - exit(0); -} - static disorder_client *getclient(void) { if(!client) { if(!(client = disorder_new(1))) exit(EXIT_FAILURE); @@ -618,11 +612,11 @@ int main(int argc, char **argv) { pcre_malloc = xmalloc; pcre_free = xfree; if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale"); - while((n = getopt_long(argc, argv, "hVc:dHlNu:p:", options, 0)) >= 0) { + while((n = getopt_long(argc, argv, "+hVc:dHlNu:p:", options, 0)) >= 0) { switch(n) { case 'h': help(); case 'H': help_commands(); - case 'V': version(); + case 'V': version("disorder"); case 'c': configfile = optarg; break; case 'd': debugging = 1; break; case 'l': local = 1; break;