Add separate *_usage() functions for each nvmecontrol command.
Sponsored by: Intel MFC after: 3 days
This commit is contained in:
parent
247f8065f6
commit
d44eb52f68
@ -288,6 +288,14 @@ open_dev(const char *str, int *fd, int show_error, int exit_on_error)
|
||||
return (EX_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
devlist_usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage:\n");
|
||||
fprintf(stderr, DEVLIST_USAGE);
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
static void
|
||||
devlist(int argc, char *argv[])
|
||||
{
|
||||
@ -302,7 +310,7 @@ devlist(int argc, char *argv[])
|
||||
while ((ch = getopt(argc, argv, "")) != -1) {
|
||||
switch ((char)ch) {
|
||||
default:
|
||||
usage();
|
||||
devlist_usage();
|
||||
}
|
||||
}
|
||||
|
||||
@ -346,6 +354,14 @@ devlist(int argc, char *argv[])
|
||||
exit(EX_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
identify_usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage:\n");
|
||||
fprintf(stderr, IDENTIFY_USAGE);
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
static void
|
||||
identify_ctrlr(int argc, char *argv[])
|
||||
{
|
||||
@ -362,7 +378,7 @@ identify_ctrlr(int argc, char *argv[])
|
||||
hexflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
identify_usage();
|
||||
}
|
||||
}
|
||||
|
||||
@ -382,7 +398,7 @@ identify_ctrlr(int argc, char *argv[])
|
||||
|
||||
if (verboseflag == 1) {
|
||||
printf("-v not currently supported without -x.\n");
|
||||
usage();
|
||||
identify_usage();
|
||||
}
|
||||
|
||||
print_controller(&cdata);
|
||||
@ -407,7 +423,7 @@ identify_ns(int argc, char *argv[])
|
||||
hexflag = 1;
|
||||
break;
|
||||
default:
|
||||
usage();
|
||||
identify_usage();
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,7 +470,7 @@ identify_ns(int argc, char *argv[])
|
||||
|
||||
if (verboseflag == 1) {
|
||||
printf("-v not currently supported without -x.\n");
|
||||
usage();
|
||||
identify_usage();
|
||||
}
|
||||
|
||||
print_namespace(&nsdata);
|
||||
@ -467,7 +483,7 @@ identify(int argc, char *argv[])
|
||||
char *target;
|
||||
|
||||
if (argc < 2)
|
||||
usage();
|
||||
identify_usage();
|
||||
|
||||
while (getopt(argc, argv, "vx") != -1) ;
|
||||
|
||||
@ -623,6 +639,14 @@ perftest(int argc, char *argv[])
|
||||
exit(EX_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
reset_usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage:\n");
|
||||
fprintf(stderr, RESET_USAGE);
|
||||
exit(EX_USAGE);
|
||||
}
|
||||
|
||||
static void
|
||||
reset_ctrlr(int argc, char *argv[])
|
||||
{
|
||||
@ -631,7 +655,7 @@ reset_ctrlr(int argc, char *argv[])
|
||||
while ((ch = getopt(argc, argv, "")) != -1) {
|
||||
switch ((char)ch) {
|
||||
default:
|
||||
usage();
|
||||
reset_usage();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user