version 1.23, 2014/10/20 22:29:25 |
version 1.24, 2014/10/20 22:44:30 |
|
|
*/ |
*/ |
|
|
enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmd_q *); |
enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmd_q *); |
|
|
enum cmd_retval cmd_list_keys_table(struct cmd *, struct cmd_q *); |
enum cmd_retval cmd_list_keys_table(struct cmd *, struct cmd_q *); |
|
enum cmd_retval cmd_list_keys_commands(struct cmd *, struct cmd_q *); |
|
|
const struct cmd_entry cmd_list_keys_entry = { |
const struct cmd_entry cmd_list_keys_entry = { |
"list-keys", "lsk", |
"list-keys", "lsk", |
|
|
cmd_list_keys_exec |
cmd_list_keys_exec |
}; |
}; |
|
|
|
const struct cmd_entry cmd_list_commands_entry = { |
|
"list-commands", "lscm", |
|
"", 0, 0, |
|
"", |
|
0, |
|
cmd_list_keys_exec |
|
}; |
|
|
enum cmd_retval |
enum cmd_retval |
cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) |
cmd_list_keys_exec(struct cmd *self, struct cmd_q *cmdq) |
{ |
{ |
|
|
size_t used; |
size_t used; |
int width, keywidth; |
int width, keywidth; |
|
|
|
if (self->entry == &cmd_list_commands_entry) |
|
return (cmd_list_keys_commands(self, cmdq)); |
|
|
if (args_has(args, 't')) |
if (args_has(args, 't')) |
return (cmd_list_keys_table(self, cmdq)); |
return (cmd_list_keys_table(self, cmdq)); |
|
|
|
|
mbind->arg != NULL ? mbind->arg : "", |
mbind->arg != NULL ? mbind->arg : "", |
mbind->arg != NULL ? "\"": ""); |
mbind->arg != NULL ? "\"": ""); |
} |
} |
|
} |
|
|
|
return (CMD_RETURN_NORMAL); |
|
} |
|
|
|
enum cmd_retval |
|
cmd_list_keys_commands(unused struct cmd *self, struct cmd_q *cmdq) |
|
{ |
|
const struct cmd_entry **entryp; |
|
struct cmd_entry *entry; |
|
|
|
for (entryp = cmd_table; *entryp != NULL; entryp++) { |
|
entry = *entryp; |
|
if (entry->alias == NULL) { |
|
cmdq_print(cmdq, "%s %s", entry->name, entry->usage); |
|
continue; |
|
} |
|
cmdq_print(cmdq, "%s (%s) %s", entry->name, entry->alias, |
|
entry->usage); |
} |
} |
|
|
return (CMD_RETURN_NORMAL); |
return (CMD_RETURN_NORMAL); |