Commit b76d864e authored by Radostin Stoyanov's avatar Radostin Stoyanov Committed by Andrei Vagin

crtools: Move deprecated checks at the end

The `show` and `exec` commands have been deprecated for some time,
and it is unlikely to be called by users. It would be better to move
them the end of the sequence of if-statements.
Signed-off-by: 's avatarRadostin Stoyanov <rstoyanov1@gmail.com>
parent 2ffd191b
......@@ -124,11 +124,6 @@ int main(int argc, char *argv[], char *envp[])
goto usage;
}
if (!strcmp(argv[optind], "exec")) {
pr_msg("The \"exec\" action is deprecated by the Compel library.\n");
return -1;
}
has_sub_command = (argc - optind) > 1;
if (has_exec_cmd) {
......@@ -237,12 +232,6 @@ int main(int argc, char *argv[], char *envp[])
return ret != 0;
}
if (!strcmp(argv[optind], "show")) {
pr_msg("The \"show\" action is deprecated by the CRIT utility.\n");
pr_msg("To view an image use the \"crit decode -i $name --pretty\" command.\n");
return -1;
}
if (!strcmp(argv[optind], "lazy-pages"))
return cr_lazy_pages(opts.daemon_mode) != 0;
......@@ -269,6 +258,17 @@ int main(int argc, char *argv[], char *envp[])
return cpuinfo_check();
}
if (!strcmp(argv[optind], "exec")) {
pr_msg("The \"exec\" action is deprecated by the Compel library.\n");
return -1;
}
if (!strcmp(argv[optind], "show")) {
pr_msg("The \"show\" action is deprecated by the CRIT utility.\n");
pr_msg("To view an image use the \"crit decode -i $name --pretty\" command.\n");
return -1;
}
pr_msg("Error: unknown command: %s\n", argv[optind]);
usage:
pr_msg("\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment