Package: ngircd
Version: 0.10.3-2
Severity: wishlist

Attached a patch that adds -h and -V chort options (to complement the
usage).

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-2-686 (SMP w/1 CPU core)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=ISO-8859-1) (ignored: 
LC_ALL set to en_US)
Shell: /bin/sh linked to /bin/dash
>From 0d806d2ad09dd3bb88fd3420c2b64b4c8fa95b92 Mon Sep 17 00:00:00 2001
From: Jari Aalto <[EMAIL PROTECTED]>
Date: Fri, 15 Feb 2008 21:29:24 +0200
Subject: [PATCH] src/ngircd/ngircd.c: Add -V, -h options. man/ngircd.8: 
Document new options

Signed-off-by: Jari Aalto <[EMAIL PROTECTED]>
---
 man/ngircd.8        |    4 ++--
 src/ngircd/ngircd.c |   19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/man/ngircd.8 b/man/ngircd.8
index 18b5f16..5e73858 100644
--- a/man/ngircd.8
+++ b/man/ngircd.8
@@ -49,10 +49,10 @@ CONNECT later on as IRC Operator to link this ngIRCd to 
other servers.
 \fB\-t\fR, \fB\-\-configtest\fR
 Read, validate and display the configuration; then exit.
 .TP
-\fB\-\-version\fR
+\fB\-V\fR, \fB\-\-version\fR
 Output version information and exit.
 .TP
-\fB\-\-help\fR
+\fB\-h\fR, \fB\-\-help\fR
 Display a brief help text and exit.
 .SH FILES
 .I /usr/local/etc/ngircd.conf
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 2fe858c..a101be3 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -188,6 +188,15 @@ main( int argc, const char *argv[] )
                                                ok = true;
                                        }
                                }
+
+                               if( argv[i][n] == 'h' )
+                               {
+                                       Show_Version( );
+                                       puts( "" ); Show_Help( ); puts( "" );
+                                       exit( 1 );
+                                       ok = true;
+                               }
+
                                if( argv[i][n] == 'n' )
                                {
                                        NGIRCd_NoDaemon = true;
@@ -211,6 +220,12 @@ main( int argc, const char *argv[] )
                                        ok = true;
                                }
 
+                               if( argv[i][n] == 'v' )
+                               {
+                                       Show_Version( );
+                                       exit( 1 );
+                               }
+
                                if( ! ok )
                                {
                                        printf( "%s: invalid option 
\"-%c\"!\n", PACKAGE_NAME, argv[i][n] );
@@ -571,8 +586,8 @@ Show_Help( void )
        puts( "  -s, --sniffer      enable network sniffer and display all IRC 
traffic" );
 #endif
        puts( "  -t, --configtest   read, validate and display configuration; 
then exit" );
-       puts( "      --version      output version information and exit" );
-       puts( "      --help         display this help and exit" );
+       puts( "  -V, --version      output version information and exit" );
+       puts( "  -h, --help         display this help and exit" );
 } /* Show_Help */
 
 
-- 
1.5.3.8

Reply via email to