Bluetooth: Shell: Make error message for unknown parameter consistent

Also simplify it by having the 'unknown parameter:' as part of the
message format.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2018-10-02 16:18:38 +03:00 committed by Carles Cufí
commit 76714c1480
6 changed files with 10 additions and 7 deletions

View file

@ -583,8 +583,7 @@ static int cmd_br(const struct shell *shell, size_t argc, char **argv)
return 0;
}
shell_fprintf(shell, SHELL_ERROR, "%s:%s%s\r\n", argv[0],
"unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}

View file

@ -1423,7 +1423,8 @@ static int cmd_bt(const struct shell *shell, size_t argc, char **argv)
return 0;
}
error(shell, "%s:%s%s", argv[0], "unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}

View file

@ -823,7 +823,8 @@ static int cmd_gatt(const struct shell *shell, size_t argc, char **argv)
return 0;
}
error(shell, "%s:%s%s", argv[0], "unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}

View file

@ -325,7 +325,8 @@ static int cmd_l2cap(const struct shell *shell, size_t argc, char **argv)
return 0;
}
error(shell, "%s:%s%s", argv[0], "unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}

View file

@ -259,7 +259,8 @@ static int cmd_rfcomm(const struct shell *shell, size_t argc, char **argv)
return 0;
}
error(shell, "%s:%s%s", argv[0], "unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}

View file

@ -93,7 +93,7 @@ static int cmd_hrs(const struct shell *shell, size_t argc, char **argv)
return 0;
}
error(shell, "%s:%s%s", argv[0], "unknown parameter: ", argv[1]);
error(shell, "%s unknown parameter: %s", argv[0], argv[1]);
return -ENOEXEC;
}