29 const char *doc = p_subcmd->
doc ?
31 printf(
"%s ", psz_subcmd_name);
32 printf(
"%s\n%s.", p_subcmd->
name, doc);
34 printf(
"%s ", psz_subcmd_name);
41 printf(
" is %d.", *(
int *)(p_subcmd->
var));
54 if (!psz_args || !*psz_args) {
55 printf(
"%s\n\n%s\n", p_command->
use, p_command->
doc);
57 for (i = 0; subcommands[i].
name; i++) {
59 subcommands[i].min_abbrev)) {
61 &(subcommands[i]),
true);
65 dbg_errmsg(
"There is no \"%s %s\" command.", psz_subcmd_name, psz_args);
71 is_alias(
const char *psz_command_name,
const alias_cmd_t *p_alias)
73 return strcmp (psz_command_name, p_alias->command) == 0;
81 if (!psz_args || !*psz_args) {
82 printf (
" Command Short Name Aliases\n");
83 printf (
" ---------------------- ---------- ---------\n");
84 for (i = 0;
commands[i].long_name; i++) {
89 short_command[s].use,
commands[i].short_name);
90 for (j = 0; aliases[j].alias; j++) {
91 if (is_alias(
commands[i].long_name, &aliases[j])) {
93 printf(
" %s", aliases[j].alias);
96 printf(
", %s", aliases[j].alias);
103 dbg_msg(
"\nReadline command line editing (emacs/vi mode) is available.\n" 104 "For more detailed help, type 'help COMAMND-NAME' or consult\n" 105 "the online-documentation.\n");
109 const char *psz_command =
"";
111 if (1 == strlen(psz_args)) {
112 if ( NULL != short_command[(uint8_t)psz_args[0]].func )
113 p_command = &short_command[(uint8_t)psz_args[0]];
118 p_command = find_command (psz_command);
125 }
else if ( p_command->
func == &dbg_cmd_set ) {
129 printf(
"%s\n\n", p_command->
use);
130 printf(
"%s\n", p_command->
doc);
131 printf(
"\nShort name and aliases: %c", p_long_command->
short_name);
132 for (
int j = 0; aliases[j].alias; j++) {
134 printf(
", %s", aliases[j].alias);
141 dbg_errmsg(
"Undefined command `%s'. Try help for a list of commands.\n",
150 dbg_cmd_help_init(
unsigned int c)
153 short_command[c].use =
_(
"help [COMMAND]");
subcommand_var_info_t show_subcommands[]
Definition: show.h:24
const char * use
Definition: debugger.h:19
Definition: debugger.h:16
const char * name
Definition: subcmd.h:5
Definition: commands.h:27
subcommand_var_info_t set_subcommands[]
Definition: set.h:31
debug_return_t dbg_cmd_info(char *psz_args)
Definition: command/info.h:284
bool is_abbrev_of(const char *psz_substr, const char *psz_word, unsigned int i_min)
debug_return_t dbg_cmd_show(char *psz_args)
Definition: show.h:81
debug_return_t
Definition: trace.h:32
dbg_cmd_t func
Definition: debugger.h:17
const char * short_doc
Definition: subcmd.h:6
debug_return_t dbg_cmd_help(char *psz_args)
Definition: help.h:77
#define _(msgid)
Definition: make.h:293
const char * doc
Definition: debugger.h:18
uint8_t id
Definition: debugger.h:20
const char * var_to_on_off(int i_bool)
char * get_word(char **ppsz_str)
const char * long_name
Definition: debugger.h:9
void dbg_help_subcmd_entry(const char *psz_subcmd_name, const char *psz_fmt, subcommand_var_info_t *p_subcmd, bool full_info)
Definition: help.h:25
const char * doc
Definition: subcmd.h:7
const char short_name
Definition: debugger.h:10
debug_return_t dbg_help_subcmd(const char *psz_subcmd_name, short_cmd_t *p_command, const char *psz_args, subcommand_var_info_t *subcommands)
Definition: help.h:49
subcommand_var_info_t info_subcommands[]
Definition: command/info.h:57
bool b_onoff
Definition: subcmd.h:10
int * var
Definition: subcmd.h:8