--- embedtools/src/dwds.c 2010/10/27 13:29:06 1.1.2.2 +++ embedtools/src/dwds.c 2010/10/27 13:50:03 1.1.2.3 @@ -10,9 +10,9 @@ extern char compiled[], compiledby[], compilehost[]; static void Usage() { - printf( "dWDS - WiFi dynamic WDS service managment for VAP\n" + printf( "-= dWDS =- WiFi dynamic WDS service managment for VAP\n" "=== %s === %s@%s ===\n\n" - " Syntax: dwds [options] [interface(s) ...]\n" + " Syntax: dwds [options] [interface [...]]\n" "\n" "\t-v\t\tVerbose ...\n" "\t-f\t\tForeground, not demonize process ...\n" @@ -26,6 +26,30 @@ int main(int argc, char **argv) { char ch, fg = 0; + + while ((ch = getopt(argc, argv, "hvfc:")) != -1) + switch (ch) { + case 'v': + Verbose++; + break; + case 'f': + fg = 1; + break; + case 'c': + strlcpy(szConfig, optarg, MAXPATHLEN); + break; + case 'h': + default: + Usage(); + return 1; + } + argc -= optind; + argv += optind; + if (!argc) { + printf("Error:: not specified interface for use ...\n"); + Usage(); + return 1; + } return 0; }