We can use it even in read-only environment where a try to initialise
file-based locking fails (not to mention other processing related with
lvm2 init). Simply, we want to output the version only, nothing else.
And this should always work.
unsetenv("LVM_DID_EXEC");
}
+ /* "version" command is simple enough so it doesn't need any complex init */
+ if (!alias && argc > 1 && !strcmp(argv[1], "version"))
+ return version(NULL, argc, argv);
+
if (!(cmd = init_lvm()))
return -1;