help.c (518B)
1 #include <stddef.h> 2 3 #include "registry.h" 4 #include "usage.h" 5 6 static int cmd_help(int argc, const char **argv) { 7 (void)argc; 8 (void)argv; 9 cli_print_global_usage(); 10 return 0; 11 } 12 13 static struct cli_command help_command = { 14 .names = (const char *const[]){"help", NULL}, 15 .display = "help", 16 .description = "Show this help", 17 .help = "sfinx help", 18 .fn = cmd_help, 19 }; 20 21 __attribute__((constructor)) static void help_register(void) { 22 cli_command_register(&help_command); 23 }