Add Network Tools And Nested Command Completion
This commit is contained in:
+10
-3
@@ -140,12 +140,19 @@ static int queue_writer_request(bool request)
|
||||
|
||||
static void print_usage(void)
|
||||
{
|
||||
printf("Usage: usb status|counters|clear-counters|request-writer|release-writer\n");
|
||||
printf("Usage:\n");
|
||||
printf(" usb status\n");
|
||||
printf(" usb counters|clear-counters\n");
|
||||
printf(" usb request-writer|release-writer\n");
|
||||
}
|
||||
|
||||
static int command_usb(int argc, char **argv)
|
||||
{
|
||||
if (argc == 1 || (argc == 2 && strcmp(argv[1], "status") == 0)) {
|
||||
if (argc == 1 || (argc == 2 && strcmp(argv[1], "help") == 0)) {
|
||||
print_usage();
|
||||
return 0;
|
||||
}
|
||||
if (argc == 2 && strcmp(argv[1], "status") == 0) {
|
||||
return show_status();
|
||||
}
|
||||
if (argc == 2 && strcmp(argv[1], "counters") == 0) {
|
||||
@@ -175,7 +182,7 @@ esp_err_t usb_console_register_commands(void)
|
||||
{
|
||||
const esp_console_cmd_t command = {
|
||||
.command = "usb",
|
||||
.help = "Inspect native USB CDC and manage its broker writer request",
|
||||
.help = "Inspect native USB CDC and manage writer ownership; run 'usb' for subcommands",
|
||||
.hint = NULL,
|
||||
.func = &command_usb,
|
||||
.argtable = NULL,
|
||||
|
||||
Reference in New Issue
Block a user