The error message should show argv[0] when an unrecognized option is detected when using lvm in script mode. # ./lvm /dev/null --config fff /dev/null: unrecognized option '--config' Error during parsing of command line.
It also appears to be silently ignoring additional positional arguments, which similarly have no effect and generate an error.
(Whether or not we can easily support --config in that situation is a separate question - I suspect it's not easy or we'd already have done it.)
Three commits here fix up the inconsistent handling of invalid commands in command/shell/script https://sourceware.org/git/?p=lvm2.git;a=shortlog;h=refs/heads/dev-dct-no-such-command-2
@teigland: That ref seems to be missing now. Did it get merged (there's no merge entries so I can't easily tell without having copies of those commits elsewhere).
> That ref seems to be missing now. Did it get merged (there's no merge > entries so I can't easily tell without having copies of those commits > elsewhere). They are in the master branch. There may be another patch or two related to this. commit cf3a6bbbe881d9a4ba6d108304f0c07ee6cd8d1a Author: David Teigland <teigland> Date: Mon May 8 10:50:27 2017 -0500 commands: fix handing of ENO_SUCH_CMD in script Fix the error messages when an unrecognized command is run from a script. We shouldn't attempt to parse options for an unrecognized command name, which causes misleading errors about bad options, but rather exit right when we know the command name is not valid. Also don't complain about exiting without an error message when running a script if no command didn't exist. commit 85f1814e9dc574c271cfdae91adfe2628ff62fa9 Author: David Teigland <teigland> Date: Mon May 8 10:31:30 2017 -0500 commands: centralize shell vs script vs command decision This clarifies the point where lvm decides if it is running an lvm shell, command or a script.
thanks, so they will be in 2.02.173.