From f9f7891cc5fd7f3d78ffc752b4dd0360c354d826 Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 29 Oct 2007 11:28:59 +0000 Subject: [PATCH] Verbose/Quiet are mutually exclusive Don't print Goodbye when quiet git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@165 bc163920-b10d-0410-b2c5-a5491ca2ceef --- CHANGES | 1 + cmdline.c | 7 ++++++- proxytunnel.c | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 6165af2..83c52b2 100755 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ Changes to proxytunnel version 1.8.0 -- TBD - Added passfile options to read username/password from a file - Moved manual-page from debian/ to / in source-tree +- Cleanup quiet mode, quiet/verbose mutually exclusive (fd0) Changes to proxytunnel version 1.7.2 -- Mon Jul 30 10:18:26 CEST 2007 diff --git a/cmdline.c b/cmdline.c index b9096bb..412157c 100644 --- a/cmdline.c +++ b/cmdline.c @@ -40,7 +40,7 @@ static char *getCredentialsFromFile( const char* filename, char **user, char **p void cmdline_parser_print_version (void) { - printf ("%s %s (rev %d)\nCopyright 2001-2006 Proxytunnel Project\n%s\n", PACKAGE, VERSION, REV, AUTHORS); + printf ("%s %s (rev %d)\nCopyright 2001-2007 Proxytunnel Project\n%s\n", PACKAGE, VERSION, REV, AUTHORS); } void @@ -412,6 +412,11 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar break; case 'v': /* Turn on verbosity. */ + if (args_info->quiet_flag) /* -q also on cmd line */ + { + fprintf (stderr, "-v and -q are mutually exclusive\n"); + exit(1); + } args_info->verbose_flag = !(args_info->verbose_flag); break; diff --git a/proxytunnel.c b/proxytunnel.c index 39c4582..aaf769f 100644 --- a/proxytunnel.c +++ b/proxytunnel.c @@ -143,7 +143,10 @@ void closeall() { message( "Tunnel closed\n" ); } - message( "Goodbye" ); + if( !args_info.quiet_flag ) + { + message( "Goodbye" ); + } #ifndef CYGWIN closelog();