1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 10:25:13 +03:00

lvm: report error if options are set before command

Previously, strange parsing errors were reported.
This commit is contained in:
David Teigland 2017-07-10 11:00:28 -05:00
parent 442d60842d
commit 56768ce36b

View File

@ -3438,6 +3438,11 @@ int lvm2_main(int argc, char **argv)
if (!alias && (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")))
argv[1] = (char *)"help";
if (!alias && (*argv[1] == '-')) {
log_error("Specify options after a command: lvm [command] [options].");
return -1;
}
if (!(cmd = init_lvm(0, 0)))
return -1;