Index: ddclient-3.6.7/ddclient
===================================================================
--- ddclient-3.6.7.orig/ddclient	2006-04-05 01:51:55.000000000 +0200
+++ ddclient-3.6.7/ddclient	2006-04-05 01:53:59.000000000 +0200
@@ -475,6 +475,12 @@
 
 test_geturl(opt('geturl')) if opt('geturl');
 
+## process help option
+if (opt('help')) {
+    *STDERR = *STDOUT;
+    usage(0);
+}
+
 ## read config file because 'daemon' mode may be defined there.
 read_config(define($opt{'file'}, default('file')), \%config, \%globals);
 init_config();
@@ -1020,16 +1026,14 @@
 	    $config{$h}{'cacheable'} = [ @{$services{$proto}{'cacheable'}} ];
 	}
     }
-    if (opt('help')) {
-	*STDERR = *STDOUT;
-	usage();
-    }
 }
 
 ######################################################################
 ## usage
 ######################################################################
 sub usage {
+    my $exitcode = 1;
+    $exitcode = shift if @_ != 0; # use first arg if given
     my $msg = '';
     if (@_) {
 	my $format = shift;
@@ -1039,7 +1043,7 @@
     }
     printf STDERR "%s%s\n", $msg, $opt_usage;
     sendmail();
-    exit 1;
+    exit $exitcode;
 }
 
 ######################################################################
