Fix geom's "usage" generation to not fabricate usage/help output for any

imaginary class we give it.

Differential Revision:	https://reviews.freebsd.org/D1150
Submitted by:	homerj
Approved by:	pjd
This commit is contained in:
Mark Felder 2014-11-17 15:19:57 +00:00
parent f88076f062
commit e2d52f146f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274631

View File

@ -640,6 +640,11 @@ get_class(int *argc, char ***argv)
#endif /* !STATIC_GEOM_CLASSES */
set_class_name();
/* If we can't load or list, it's not a class. */
if (!std_available("load") && !std_available("list"))
errx(EXIT_FAILURE, "Invalid class name.");
if (*argc < 1)
usage();
}