Improve commands documentation

This commit is contained in:
Maxime Coste 2014-06-06 13:58:35 +01:00
parent be8f875b4f
commit 732d1c3bd1

View File

@ -483,9 +483,14 @@ CandidateList complete_scope(StringView prefix)
const CommandDesc add_hook_cmd = { const CommandDesc add_hook_cmd = {
"hook", "hook",
nullptr, nullptr,
"hook <switches> <scope> <hook_name> <command>: add <command> to be executed on hook <hook_name> in <scope> context", "hook <switches> <scope> <hook_name> <command>: add <command> in <scope> to be executed on hook <hook_name>\n"
"scope can be: \n"
" * global: hook is executed for any buffer or window\n"
" * buffer: hook is executed only for the current buffer\n"
" (and any window for that buffer)\n"
" * window: hook is executed only for the current window\n",
ParameterDesc{ ParameterDesc{
SwitchMap{ { "id", { true, "set hook id" } } }, SwitchMap{ { "id", { true, "set hook id, see rmhooks" } } },
ParameterDesc::Flags::None, 4, 4 ParameterDesc::Flags::None, 4, 4
}, },
CommandFlags::None, CommandFlags::None,
@ -520,7 +525,7 @@ const CommandDesc add_hook_cmd = {
const CommandDesc rm_hook_cmd = { const CommandDesc rm_hook_cmd = {
"rmhooks", "rmhooks",
nullptr, nullptr,
"rmhooks <id>: remove all hooks that whose id is <id>", "rmhooks <id>: remove all hooks whose id is <id>",
ParameterDesc{ SwitchMap{}, ParameterDesc::Flags::None, 2, 2 }, ParameterDesc{ SwitchMap{}, ParameterDesc::Flags::None, 2, 2 },
CommandFlags::None, CommandFlags::None,
CommandCompleter{}, CommandCompleter{},
@ -696,7 +701,8 @@ const CommandDesc echo_cmd = {
const CommandDesc debug_cmd = { const CommandDesc debug_cmd = {
"debug", "debug",
nullptr, nullptr,
"debug <params>...: write debug informations in debug buffer", "debug <command>: write some debug informations in the debug buffer\n"
" existing commands: info",
ParameterDesc{ SwitchMap{}, ParameterDesc::Flags::SwitchesOnlyAtStart, 1 }, ParameterDesc{ SwitchMap{}, ParameterDesc::Flags::SwitchesOnlyAtStart, 1 },
CommandFlags::None, CommandFlags::None,
CommandCompleter{}, CommandCompleter{},
@ -794,7 +800,7 @@ const CommandDesc declare_option_cmd = {
"decl", "decl",
nullptr, nullptr,
"decl <type> <name> [value]: declare option <name> of type <type>.\n" "decl <type> <name> [value]: declare option <name> of type <type>.\n"
"set its initial value to <value> if given\n" "set its initial value to <value> if given and if the option did not exist\n"
"Available types:\n" "Available types:\n"
" int: integer\n" " int: integer\n"
" bool: boolean (true/false or yes/no)\n" " bool: boolean (true/false or yes/no)\n"
@ -847,7 +853,6 @@ const CommandDesc declare_option_cmd = {
} }
}; };
KeymapManager& get_keymap_manager(const String& scope, Context& context) KeymapManager& get_keymap_manager(const String& scope, Context& context)
{ {
if (prefix_match("global", scope)) if (prefix_match("global", scope))
@ -1037,7 +1042,7 @@ const CommandDesc exec_string_cmd = {
const CommandDesc eval_string_cmd = { const CommandDesc eval_string_cmd = {
"eval", "eval",
nullptr, nullptr,
"eval <switches> <keys>: execute commands as if entered by user", "eval <switches> <commands>...: execute commands as if entered by user",
context_wrap_params, context_wrap_params,
CommandFlags::None, CommandFlags::None,
CommandCompleter{}, CommandCompleter{},