From 03172ff5259d9253f0f3a660f18836c6a90a2fc7 Mon Sep 17 00:00:00 2001 From: markster Date: Mon, 10 Jan 2005 04:06:49 +0000 Subject: Make debug settable (thanks twisted, bug #3302) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@535 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- ztcfg.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ztcfg.c') diff --git a/ztcfg.c b/ztcfg.c index 52a09a1..a1a8a72 100755 --- a/ztcfg.c +++ b/ztcfg.c @@ -1096,6 +1096,7 @@ static void usage(char *argv0, int exitcode) " -c -- Use instead of " CONFIG_FILENAME "\n" " -h -- Generate this help statement\n" " -v -- Verbose (more -v's means more verbose)\n" + " -d [level] -- Generate debugging output. (Default level is 1.)\n" " -t -- Test mode only, do not apply\n" " -s -- Shutdown spans only\n" ,c); @@ -1108,7 +1109,7 @@ int main(int argc, char *argv[]) char *buf; char *key, *value; int x,found; - while((c = getopt(argc, argv, "thc:vs")) != -1) { + while((c = getopt(argc, argv, "thc:vsd::")) != -1) { switch(c) { case 'c': filename=optarg; @@ -1128,6 +1129,12 @@ int main(int argc, char *argv[]) case 's': stopmode = 1; break; + case 'd': + if (optarg) + debug = atoi(optarg); + else + debug = 1; + break; } } if (fd == -1) fd = open(MASTER_DEVICE, O_RDWR); -- cgit v1.2.3