summaryrefslogtreecommitdiffstats
path: root/drivers/staging/usbip
diff options
context:
space:
mode:
authormatt mooney2011-06-20 07:44:39 +0200
committerGreg Kroah-Hartman2011-07-06 05:11:34 +0200
commit4737d7e3321a2f1e8804ceee3f938eff09593c0a (patch)
treef52227deb6a0ca7b484671a1365ec5de71d6b4e0 /drivers/staging/usbip
parentstaging: usbip: userspace: libsrc: change all output messages to debug (diff)
downloadkernel-qcow2-linux-4737d7e3321a2f1e8804ceee3f938eff09593c0a.tar.gz
kernel-qcow2-linux-4737d7e3321a2f1e8804ceee3f938eff09593c0a.tar.xz
kernel-qcow2-linux-4737d7e3321a2f1e8804ceee3f938eff09593c0a.zip
staging: usbip: userspace: usbip: modify command failure
When a bad option is given, display a message stating such and output usage. When a bad command is given, output command help. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/usbip')
-rw-r--r--drivers/staging/usbip/userspace/src/usbip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/staging/usbip/userspace/src/usbip.c b/drivers/staging/usbip/userspace/src/usbip.c
index cdfe4c2d9cbe..583b179a1126 100644
--- a/drivers/staging/usbip/userspace/src/usbip.c
+++ b/drivers/staging/usbip/userspace/src/usbip.c
@@ -125,13 +125,13 @@ static int usbip_version(int argc, char *argv[])
(void) argc;
(void) argv;
- printf("%s\n", usbip_version_string);
+ printf(PROGNAME " (%s)\n", usbip_version_string);
return 0;
}
static int run_command(const struct command *cmd, int argc, char *argv[])
{
- dbg("running command: `%s'\n", cmd->name);
+ dbg("running command: `%s'", cmd->name);
return cmd->fn(argc, argv);
}
@@ -163,8 +163,11 @@ int main(int argc, char *argv[])
usbip_use_syslog = 1;
openlog("", LOG_PID, LOG_USER);
break;
+ case '?':
+ printf("usbip: invalid option\n");
default:
- goto err_out;
+ usbip_usage();
+ goto out;
}
}
@@ -180,8 +183,8 @@ int main(int argc, char *argv[])
}
}
-err_out:
- usbip_usage();
+ /* invalid command */
+ usbip_help(0, NULL);
out:
return (rc > -1 ? EXIT_SUCCESS : EXIT_FAILURE);
}