1
1
mirror of https://github.com/mawww/kakoune.git synced 2024-11-15 01:11:09 +03:00

Docs: add missing [<switches>] in commands signatures

This commit is contained in:
Delapouite 2018-03-17 15:41:56 +01:00
parent 0a2807e652
commit 00cb49438a
2 changed files with 26 additions and 26 deletions

View File

@ -79,12 +79,12 @@ command *q!* has to be used). Aliases are mentionned below each commands.
== Options == Options
*declare-option* [-hidden] <type> <name> [<value>]:: *declare-option* [<switches>] <type> <name> [<value>]::
*alias* decl + *alias* decl +
declare a new option, the -hidden hides the option in completion declare a new option, the -hidden switch hides the option in completion
suggestions (See <<options#declare-option,`:doc options declare-option`>>) suggestions (See <<options#declare-option,`:doc options declare-option`>>)
*set-option* <scope> <name> <value>:: *set-option* [<switches>] <scope> <name> <value>::
*alias* set + *alias* set +
change the value of an option change the value of an option
note that the name of a particular buffer can be specified when the note that the name of a particular buffer can be specified when the
@ -103,7 +103,7 @@ command *q!* has to be used). Aliases are mentionned below each commands.
== Commands and Keys == Commands and Keys
*define-command* [<flags>] <name> <command>:: *define-command* [<switches>] <name> <command>::
*alias* def + *alias* def +
define a new command (See <<declaring-new-commands,Declaring new commands>>) define a new command (See <<declaring-new-commands,Declaring new commands>>)
@ -114,16 +114,16 @@ command *q!* has to be used). Aliases are mentionned below each commands.
remove an alias if its current value is the same as the one passed remove an alias if its current value is the same as the one passed
as an optional parameter, remove it unconditionally otherwise as an optional parameter, remove it unconditionally otherwise
*evaluate-commands* [<flags>] <command> ...:: *evaluate-commands* [<switches>] <command> ...::
*alias* eval + *alias* eval +
evaluate commands, as if they were entered in the command prompt evaluate commands, as if they were entered in the command prompt
(See <<execeval#,`:doc execeval`>>) (See <<execeval#,`:doc execeval`>>)
*execute-keys* [<flags>] <key> ...:: *execute-keys* [<switches>] <key> ...::
*alias* exec + *alias* exec +
execute a series of keys, as if they were hit (See <<execeval#,`:doc execeval`>>) execute a series of keys, as if they were hit (See <<execeval#,`:doc execeval`>>)
*map* <scope> <mode> <key> <keys>:: *map* [<switches>] <scope> <mode> <key> <keys>::
bind a list of keys to a combination (See <<mapping#,`:doc mapping`>>) bind a list of keys to a combination (See <<mapping#,`:doc mapping`>>)
*unmap* <scope> <mode> <key> [<expected>]:: *unmap* <scope> <mode> <key> [<expected>]::
@ -132,7 +132,7 @@ command *q!* has to be used). Aliases are mentionned below each commands.
*declare-user-mode* <name>:: *declare-user-mode* <name>::
declare a new user keymap mode declare a new user keymap mode
*enter-user-mode* <name>:: *enter-user-mode* [<switches>] <name>::
enable <name> keymap mode for next key enable <name> keymap mode for next key
*-lock*::: *-lock*:::
@ -151,8 +151,8 @@ command *q!* has to be used). Aliases are mentionned below each commands.
== Display == Display
*echo* [options] <text>:: *echo* [<switches>] <text>::
show *text* in status line, with the following *options*: show *text* in status line, with the following *switches*:
*-markup*::: *-markup*:::
expand the markup strings in *text* (See expand the markup strings in *text* (See
@ -168,7 +168,7 @@ command *q!* has to be used). Aliases are mentionned below each commands.
*colorscheme* <name>:: *colorscheme* <name>::
load named colorscheme load named colorscheme
*add-highlighter* [<flags>] <highlighter_name> <highlighter_parameters> ...:: *add-highlighter* <highlighter_name> <highlighter_parameters> ...::
*alias* addhl + *alias* addhl +
add a highlighter to the current window add a highlighter to the current window
(See <<highlighters#,`:doc highlighters`>>) (See <<highlighters#,`:doc highlighters`>>)
@ -184,7 +184,7 @@ Kakoune provides some helper commands that can be used to define composite
commands in scripts. They are also available in the interactive mode, commands in scripts. They are also available in the interactive mode,
but not really useful in that context. but not really useful in that context.
*prompt* <prompt> <command>:: *prompt* [<switches>] <prompt> <command>::
prompt the user for a string, when the user validates, executes the prompt the user for a string, when the user validates, executes the
command. The entered text is available in the `text` value accessible command. The entered text is available in the `text` value accessible
through `$kak_text` in shells or `%val{text}` in commands. through `$kak_text` in shells or `%val{text}` in commands.
@ -202,7 +202,7 @@ but not really useful in that context.
available through the `key` value, accessible through `$kak_key` available through the `key` value, accessible through `$kak_key`
in shells, or `%val{key}` in commands. in shells, or `%val{key}` in commands.
*menu* <label1> <commands1> <label2> <commands2> ...:: *menu* [<switches>] <label1> <commands1> <label2> <commands2> ...::
display a menu using labels, the selected labels commands are display a menu using labels, the selected labels commands are
executed. The *menu* command can take an *-auto-single* argument, to automatically executed. The *menu* command can take an *-auto-single* argument, to automatically
run commands when only one choice is provided, and a *-select-cmds* run commands when only one choice is provided, and a *-select-cmds*
@ -210,8 +210,8 @@ but not really useful in that context.
last one being a command to execute when the item is selected (but last one being a command to execute when the item is selected (but
not validated) not validated)
*info* [options] <text>:: *info* [<switches>] <text>::
display text in an information box with the following *options*: display text in an information box with the following *switches*:
*-anchor* <line>.<column>::: *-anchor* <line>.<column>:::
print the text at the given coordinates print the text at the given coordinates
@ -253,8 +253,8 @@ backslash (\;) to be considered as a literal semicolon argument
New commands can be defined using the *define-command* command: New commands can be defined using the *define-command* command:
*define-command* [flags] <command_name> <commands>:: *define-command* [<switches>] <command_name> <commands>::
*commands* is a string containing the commands to execute, and *flags* *commands* is a string containing the commands to execute, and *switches*
can be any combination of the following parameters: can be any combination of the following parameters:
*-params* <num>::: *-params* <num>:::

View File

@ -772,7 +772,7 @@ static Completions complete_hooks(const Context&, CompletionFlags,
const CommandDesc add_hook_cmd = { const CommandDesc add_hook_cmd = {
"hook", "hook",
nullptr, nullptr,
"hook <switches> <scope> <hook_name> <filter> <command>: add <command> in <scope> " "hook [<switches>] <scope> <hook_name> <filter> <command>: add <command> in <scope> "
"to be executed on hook <hook_name> when its parameter matches the <filter> regex\n" "to be executed on hook <hook_name> when its parameter matches the <filter> regex\n"
"<scope> can be:\n" "<scope> can be:\n"
" * global: hook is executed for any buffer or window\n" " * global: hook is executed for any buffer or window\n"
@ -1017,7 +1017,7 @@ void define_command(const ParametersParser& parser, Context& context, const Shel
const CommandDesc define_command_cmd = { const CommandDesc define_command_cmd = {
"define-command", "define-command",
"def", "def",
"define-command <switches> <name> <cmds>: define a command <name> executing <cmds>", "define-command [<switches>] <name> <cmds>: define a command <name> executing <cmds>",
ParameterDesc{ ParameterDesc{
{ { "params", { true, "take parameters, accessible to each shell escape as $0..$N\n" { { "params", { true, "take parameters, accessible to each shell escape as $0..$N\n"
"parameter should take the form <count> or <min>..<max> (both omittable)" } }, "parameter should take the form <count> or <min>..<max> (both omittable)" } },
@ -1264,7 +1264,7 @@ static OptionManager& get_options(StringView scope, const Context& context, Stri
const CommandDesc set_option_cmd = { const CommandDesc set_option_cmd = {
"set-option", "set-option",
"set", "set",
"set-option <switches> <scope> <name> <value>: set option <name> in <scope> to <value>\n" "set-option [<switches>] <scope> <name> <value>: set option <name> in <scope> to <value>\n"
"<scope> can be global, buffer, window, or current which refers to the narrowest " "<scope> can be global, buffer, window, or current which refers to the narrowest "
"scope the option is set in", "scope the option is set in",
ParameterDesc{ ParameterDesc{
@ -1448,7 +1448,7 @@ auto map_key_completer =
const CommandDesc map_key_cmd = { const CommandDesc map_key_cmd = {
"map", "map",
nullptr, nullptr,
"map <scope> <mode> <key> <keys>: map <key> to <keys> in given mode in <scope>.\n" "map [<switches>] <scope> <mode> <key> <keys>: map <key> to <keys> in given mode in <scope>.\n"
"<mode> can be:\n" "<mode> can be:\n"
" normal\n" " normal\n"
" insert\n" " insert\n"
@ -1693,7 +1693,7 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func)
const CommandDesc exec_string_cmd = { const CommandDesc exec_string_cmd = {
"execute-keys", "execute-keys",
"exec", "exec",
"execute-keys <switches> <keys>: execute given keys as if entered by user", "execute-keys [<switches>] <keys>: execute given keys as if entered by user",
context_wrap_params, context_wrap_params,
CommandFlags::None, CommandFlags::None,
CommandHelper{}, CommandHelper{},
@ -1718,7 +1718,7 @@ const CommandDesc exec_string_cmd = {
const CommandDesc eval_string_cmd = { const CommandDesc eval_string_cmd = {
"evaluate-commands", "evaluate-commands",
"eval", "eval",
"evaluate-commands <switches> <commands>...: execute commands as if entered by user", "evaluate-commands [<switches>] <commands>...: execute commands as if entered by user",
context_wrap_params, context_wrap_params,
CommandFlags::None, CommandFlags::None,
CommandHelper{}, CommandHelper{},
@ -1831,7 +1831,7 @@ const CommandDesc prompt_cmd = {
const CommandDesc menu_cmd = { const CommandDesc menu_cmd = {
"menu", "menu",
nullptr, nullptr,
"menu <switches> <name1> <commands1> <name2> <commands2>...: display a " "menu [<switches>] <name1> <commands1> <name2> <commands2>...: display a "
"menu and execute commands for the selected item", "menu and execute commands for the selected item",
ParameterDesc{ ParameterDesc{
{ { "auto-single", { false, "instantly validate if only one item is available" } }, { { "auto-single", { false, "instantly validate if only one item is available" } },
@ -1911,7 +1911,7 @@ const CommandDesc on_key_cmd = {
const CommandDesc info_cmd = { const CommandDesc info_cmd = {
"info", "info",
nullptr, nullptr,
"info <switches> <params>...: display an info box with the params as content", "info [<switches>] <params>...: display an info box with the params as content",
ParameterDesc{ ParameterDesc{
{ { "anchor", { true, "set info anchoring <line>.<column>" } }, { { "anchor", { true, "set info anchoring <line>.<column>" } },
{ "placement", { true, "set placement relative to anchor (above, below)" } }, { "placement", { true, "set placement relative to anchor (above, below)" } },
@ -2162,7 +2162,7 @@ void enter_user_mode(Context& context, const String mode_name, KeymapMode mode,
const CommandDesc enter_user_mode_cmd = { const CommandDesc enter_user_mode_cmd = {
"enter-user-mode", "enter-user-mode",
nullptr, nullptr,
"enter-user-mode <switches> <name>: enable <name> keymap mode for next key", "enter-user-mode [<switches>] <name>: enable <name> keymap mode for next key",
ParameterDesc{ ParameterDesc{
{ { "lock", { false, "stay in mode until <esc> is pressed" } } }, { { "lock", { false, "stay in mode until <esc> is pressed" } } },
ParameterDesc::Flags::SwitchesOnlyAtStart, 1, 1 ParameterDesc::Flags::SwitchesOnlyAtStart, 1, 1