- command_print(context, "%20s\t%s", name_buf, help, indent);
-
- if (command->children)
- {
- for (c = command->children; c; c = c->next)
- {
- command_print_help_line(context, c, indent + 1);
- }
- }
- free(indent_text);
-}
-
-int command_print_help_match(command_context_t* context, command_t* c_first, char* name, char** args, int argc)
-{
- command_t * c;
-
- for (c = c_first; c; c = c->next)
- {
- if (argc > 0)
- {
- if (strcasecmp(c->name, args[0]))
- continue;
-
- if (argc > 1)
- {
- command_print_help_match(context, c->children, name, args + 1, argc - 1);
- continue;
- }
- }
-
- command_print_help_line(context, c, 0);
- }
-
- return ERROR_OK;
-}
-
-int command_print_help(command_context_t* context, char* name, char** args, int argc)
-{
- return command_print_help_match(context, context->commands, name, args, argc);
-}