master - lvm: report error if options are set before command
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=56768ce36be4a63cda0fec1d06ca061d39288135 Commit: 56768ce36be4a63cda0fec1d06ca061d39288135 Parent: 442d60842d2915f82bd19382b8e08d690243ddd0 Author: David Teigland <[email protected]> AuthorDate: Mon Jul 10 11:00:28 2017 -0500 Committer: David Teigland <[email protected]> CommitterDate: Mon Jul 10 11:02:11 2017 -0500
lvm: report error if options are set before command
Previously, strange parsing errors were reported.
--- tools/lvmcmdline.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
tools/lvmcmdline.c +5 -0
@@ -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 ;