diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-04 20:50:49 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-04 20:50:49 +0200 |
commit | 64c271ed3bd50ce5ffbf69108d75bb79d279e8d9 (patch) | |
tree | 8417630cd3731793524168df8187212b510231ea /main.c | |
parent | 210b973708d62137b8283d43908292039056f415 (diff) | |
download | netifd-64c271ed3bd50ce5ffbf69108d75bb79d279e8d9.tar.gz |
rework debugging code, add debugging levels
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -10,6 +10,7 @@ #include "system.h" #include "interface.h" +unsigned int debug_mask = 0; const char *main_path = "."; static char **global_argv; @@ -42,6 +43,7 @@ static int usage(const char *progname) { fprintf(stderr, "Usage: %s [options]\n" "Options:\n" + " -d <mask>: Mask for debug messages\n" " -s <path>: Path to the ubus socket\n" " -p <path>: Path to netifd addons (default: %s)\n" "\n", progname, main_path); @@ -56,8 +58,11 @@ int main(int argc, char **argv) global_argv = argv; - while ((ch = getopt(argc, argv, "s:")) != -1) { + while ((ch = getopt(argc, argv, "d:s:")) != -1) { switch(ch) { + case 'd': + debug_mask = strtoul(optarg, NULL, 0); + break; case 's': socket = optarg; break; |