Fix offset option for loopaesOpen.

git-svn-id: https://cryptsetup.googlecode.com/svn/trunk@476 36d66b0a-2a48-0410-832c-cd162a569da5
This commit is contained in:
Milan Broz
2011-03-21 17:48:30 +00:00
parent 4382e21610
commit bce295738b
5 changed files with 71 additions and 39 deletions

View File

@@ -1249,9 +1249,15 @@ int main(int argc, char **argv)
usage(popt_context, EXIT_FAILURE, _("Option --uuid is allowed only for luksFormat and luksUUID."),
poptGetInvocationName(popt_context));
if ((opt_offset || opt_skip) && strcmp(aname, "create"))
usage(popt_context, EXIT_FAILURE, _("Options --offset and --skip are supported only for create command.\n"),
poptGetInvocationName(popt_context));
if (opt_skip && strcmp(aname, "create"))
usage(popt_context, EXIT_FAILURE,
_("Option --skip is supported only for create command.\n"),
poptGetInvocationName(popt_context));
if (opt_offset && strcmp(aname, "create") && strcmp(aname, "loopaesOpen"))
usage(popt_context, EXIT_FAILURE,
_("Option --offset is supported only for create and loopaesOpen commands.\n"),
poptGetInvocationName(popt_context));
if (opt_debug) {
opt_verbose = 1;