#include <stdlib.h>
#include <getopt.h>
+#include <syslog.h>
#include "usbip_common.h"
#include "usbip.h"
static const char usbip_version_string[] = PACKAGE_STRING;
static const char usbip_usage_string[] =
- "usbip [--debug] [version]\n"
+ "usbip [--debug] [--log] [version]\n"
" [help] <command> <args>\n";
static void usbip_usage(void)
{
static const struct option opts[] = {
{ "debug", no_argument, NULL, 'd' },
- { NULL, 0, NULL, 0 }
+ { "log", no_argument, NULL, 'l' },
+ { NULL, 0, NULL, 0 }
};
+
char *cmd;
int opt;
int i, rc = -1;
+ usbip_use_stderr = 1;
opterr = 0;
for (;;) {
opt = getopt_long(argc, argv, "+d", opts, NULL);
switch (opt) {
case 'd':
usbip_use_debug = 1;
- usbip_use_stderr = 1;
+ break;
+ case 'l':
+ usbip_use_syslog = 1;
+ openlog("", LOG_PID, LOG_USER);
break;
default:
goto err_out;