]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Send LOG_INFO to the console by default so users know what it's doing a little more...
authorRoy Marples <roy@marples.name>
Fri, 4 Jul 2008 12:08:51 +0000 (12:08 +0000)
committerRoy Marples <roy@marples.name>
Fri, 4 Jul 2008 12:08:51 +0000 (12:08 +0000)
dhcpcd.8.in
dhcpcd.c
logger.c

index ed83ac4fa79464c53153326caf4694b7444af2d0..b8a8c25677ae47b1e28eb258b5e7a675e62b7010 100644 (file)
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd Jun 30, 2008
+.Dd Jul 04, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
 .Nd an RFC 2131 compliant DHCP client
 .Sh SYNOPSIS
 .Nm
-.Op Fl dknpADEGKLSTV
+.Op Fl dknpqADEGKLSTV
 .Op Fl c , -script Ar script
 .Op Fl f , -config Ar file
 .Op Fl h , -hostname Ar hostname
@@ -307,6 +307,11 @@ However, there are sometimes situations where you don't want the things to be
 configured exactly how the the DHCP server wants.
 Here are some options that deal with turning these bits off.
 .Bl -tag -width indent
+.It Fl q , -quiet
+Quiet
+.Nm
+on the command line, only warnings and errors will be displayed.
+The messagea are still logged though.
 .It Fl A , -noarp
 Don't request or claim the address by ARP.
 This also disables IPv4LL.
index 82770af5b7afa84f4976815fd8e924e96fa7f341..663785e5554057383ef25e77357559fc80c153ef 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -52,7 +52,7 @@ const char copyright[] = "Copyright (c) 2006-2008 Roy Marples";
 
 /* Don't set any optional arguments here so we retain POSIX
  * compatibility with getopt */
-#define OPTS "c:df:h:i:kl:m:no:pr:s:t:u:v:xAC:DEF:GI:KLO:TV"
+#define OPTS "c:df:h:i:kl:m:no:pqr:s:t:u:v:xAC:DEF:GI:KLO:TV"
 
 static int doversion = 0;
 static int dohelp = 0;
@@ -68,6 +68,7 @@ static const struct option longopts[] = {
        {"renew",       no_argument,        NULL, 'n'},
        {"option",      required_argument,  NULL, 'o'},
        {"persistent",  no_argument,        NULL, 'p'},
+       {"quiet",       no_argument,        NULL, 'q'},
        {"inform",      optional_argument,  NULL, 's'},
        {"request",     optional_argument,  NULL, 'r'},
        {"timeout",     required_argument,  NULL, 't'},
@@ -157,7 +158,7 @@ read_pid(const char *pidfile)
 static void
 usage(void)
 {
-       printf("usage: "PACKAGE" [-dknpxADEGHKLOTV] [-c script] [-f file ] [-h hostname]\n"
+       printf("usage: "PACKAGE" [-dknpqxADEGHKLOTV] [-c script] [-f file ] [-h hostname]\n"
               "              [-i classID ] [-l leasetime] [-m metric] [-o option] [-r ipaddr]\n"
               "              [-s ipaddr] [-t timeout] [-u userclass] [-F none|ptr|both]\n"
               "              [-I clientID] [-C hookscript] <interface>\n");
@@ -368,6 +369,9 @@ parse_option(int opt, char *oarg, struct options *options)
        case 'p':
                options->options |= DHCPCD_PERSISTENT;
                break;
+       case 'q':
+               setloglevel(LOG_WARNING);
+               break;
        case 's':
                options->options |= DHCPCD_INFORM;
                options->options |= DHCPCD_PERSISTENT;
index e9d3de4671754114db13c03127b45b82cb2e23d8..6eb0c295de99ddd613c6f00fbbbd5336c29c1943 100644 (file)
--- a/logger.c
+++ b/logger.c
@@ -35,7 +35,7 @@
 #include "common.h"
 #include "logger.h"
 
-static int loglevel = LOG_WARNING;
+static int loglevel = LOG_INFO;
 static char logprefix[12] = {0};
 
 struct logname {