/* Prints error message on wrong argument count. Optionally, printing help on wrong argument count.  */
static int cmd_precheck(const struct shell *sh, bool arg_cnt_ok)
/* Prints error message on wrong argument count. Optionally, printing help on wrong argument count.  */
static int cmd_precheck(const struct shell *sh, bool arg_cnt_ok)
{
	if (!arg_cnt_ok) {
		z_shell_fprintf(sh, SHELL_ERROR,
				"%s: wrong parameter count\n",
				sh->ctx->active_cmd.syntax);
		if (IS_ENABLED(CONFIG_SHELL_HELP_ON_WRONG_ARGUMENT_COUNT)) {
			shell_internal_help_print(sh);
		}
		return -EINVAL;
	}
	return 0;
}