if (!best_required) {
/* cmd did not have all the required opt/pos args of any command */
- log_error("Incorrect syntax. Run '%s --help' for more information.", name);
+ log_error("No command with matching syntax recognised. Run '%s --help' for more information.", name);
if (close_ro) {
log_warn("Nearest similar command has syntax:");
print_usage(&_cmdline.commands[close_i], 0, 0);
opt_enum = best_unused_options[i];
opt_val = arg_value(cmd, opt_enum);
- log_error("Invalid option for command: %s%s%s.",
+ log_error("Command does not accept option: %s%s%s.",
arg_long_option_name(opt_enum),
opt_val ? " " : "", opt_val ?: "");
}
break;
if (count >= (commands[best_i].rp_count + commands[best_i].op_count)) {
- log_error("Invalid positional argument for command: %s.", argv[count]);
+ log_error("Command does not accept argument: %s.", argv[count]);
/* FIXME: to warn/ignore, clear so it can't be used when processing. */
/*
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, check_opts_msg, sizeof(check_opts_msg));
if (rule->opts_count)
- log_error("Invalid option combination: %s with %s", opts_msg, check_opts_msg);
+ log_error("Command does not accept option combination: %s with %s", opts_msg, check_opts_msg);
else
- log_error("Invalid options: %s", check_opts_msg);
+ log_error("Command does not accept options: %s", check_opts_msg);
return NULL;
}
if (opts_unmatch_count && (rule->rule == RULE_REQUIRE)) {
memset(check_opts_msg, 0, sizeof(check_opts_msg));
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, check_opts_msg, sizeof(check_opts_msg));
- log_error("Required options for command: %s", check_opts_msg);
+ log_error("Command requires options: %s", check_opts_msg);
return NULL;
}
}
if (!ret) {
int lvt_enum = get_lvt_enum(lv);
struct lv_type *type = get_lv_type(lvt_enum);
- log_warn("Operation on LV %s which has invalid type %s.",
+ log_warn("Command on LV %s does not accept LV type %s.",
display_lvname(lv), type ? type->name : "unknown");
}
if (rule->check_opts && (rule->rule == RULE_INVALID) && opts_match_count) {
memset(buf, 0, sizeof(buf));
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf));
- log_warn("An invalid option is set: %s", buf);
+ log_warn("Command on LV %s does not accept option %s.",
+ display_lvname(lv), buf);
ret = 0;
}
if (rule->check_opts && (rule->rule == RULE_REQUIRE) && opts_unmatch_count) {
memset(buf, 0, sizeof(buf));
opt_array_to_str(cmd, rule->check_opts, rule->check_opts_count, buf, sizeof(buf));
- log_warn("A required option is not set: %s", buf);
+ log_warn("Command on LV %s requires option %s.",
+ display_lvname(lv), buf);
ret = 0;
}
/* Fail if the LV matches any of the invalid LV types. */
if (rule->check_lvt_bits && (rule->rule == RULE_INVALID) && lv_types_match_bits) {
- log_warn("Command on LV %s with invalid type: %s",
+ log_warn("Command on LV %s does not accept LV type %s.",
display_lvname(lv), lvtype ? lvtype->name : "unknown");
ret = 0;
}
if (rule->check_lvt_bits && (rule->rule == RULE_REQUIRE) && !lv_types_match_bits) {
memset(buf, 0, sizeof(buf));
lvt_bits_to_str(rule->check_lvt_bits, buf, sizeof(buf));
- log_warn("Command on LV %s with type %s does not match required type: %s",
+ log_warn("Command on LV %s does not accept LV type %s. Required LV types are %s.",
display_lvname(lv), lvtype ? lvtype->name : "unknown", buf);
ret = 0;
}
if (rule->check_lvp_bits && (rule->rule == RULE_INVALID) && lv_props_match_bits) {
memset(buf, 0, sizeof(buf));
lvp_bits_to_str(lv_props_match_bits, buf, sizeof(buf));
- log_warn("Command on LV %s with invalid properties: %s",
+ log_warn("Command on LV %s does not accept LV with properties: %s.",
display_lvname(lv), buf);
ret = 0;
}
if (rule->check_lvp_bits && (rule->rule == RULE_REQUIRE) && lv_props_unmatch_bits) {
memset(buf, 0, sizeof(buf));
lvp_bits_to_str(lv_props_unmatch_bits, buf, sizeof(buf));
- log_warn("Command on LV %s requires properties: %s",
+ log_warn("Command on LV %s requires LV with properties: %s.",
display_lvname(lv), buf);
ret = 0;
}
if (!_check_lv_types(cmd, lvl->lv, lv_arg_pos)) {
/* FIXME: include this result in report log? */
if (lv_is_named_arg) {
- log_error("Operation not permitted on LV %s.", display_lvname(lvl->lv));
+ log_error("Command not permitted on LV %s.", display_lvname(lvl->lv));
ret_max = ECMD_FAILED;
}
continue;
if (!_check_lv_rules(cmd, lvl->lv)) {
/* FIXME: include this result in report log? */
if (lv_is_named_arg) {
- log_error("Operation not permitted on LV %s.", display_lvname(lvl->lv));
+ log_error("Command not permitted on LV %s.", display_lvname(lvl->lv));
ret_max = ECMD_FAILED;
}
continue;