34 #include "cmdhandler.h" 36 #include "clientpipe.h" 40 static const char *module_str =
"help_cmd";
55 "Without arguments print an overview of available commands for the daemon\n" 56 "and a short description of usage. With [command] set, print usage information\n" 57 "of command and extended help if available.\n\n" 62 handles(
const char *cmd)
68 run(
int sockfd, cmdhandler_ctx_type* context,
const char *cmd)
70 struct cmd_func_block* fb;
72 ods_log_debug(
"[%s] help command", module_str);
74 if (strlen(cmd) < 6) {
76 client_printf(sockfd,
"\nCommands:\n");
77 cmdhandler_get_usage(sockfd, context->cmdhandler);
79 if ((fb = get_funcblock(&cmd[5], context->cmdhandler))) {
80 client_printf(sockfd,
"Usage:\n");
82 client_printf(sockfd,
"\nHelp:\n");
86 client_printf(sockfd,
"No help available for '%s'\n",
91 client_printf(sockfd,
"Help: command '%s' unknown. Type " 92 "'help' without arguments to get a list of supported " 93 "commands.\n", cmd+5);
101 "help", &usage, &help, &handles, &run
struct cmd_func_block help_funcblock