From 9daa47fb2df8b58a3edc82ed48687205c2bd85e9 Mon Sep 17 00:00:00 2001 From: Elwardi Date: Sat, 17 Jul 2021 19:18:41 +0100 Subject: Add docs for menuFromCommand prompts --- docs/Custom_Command_Keybindings.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'docs') diff --git a/docs/Custom_Command_Keybindings.md b/docs/Custom_Command_Keybindings.md index 5a63e2241..7a9f1bc0d 100644 --- a/docs/Custom_Command_Keybindings.md +++ b/docs/Custom_Command_Keybindings.md @@ -35,6 +35,18 @@ customCommands: command: "git flow {{index .PromptResponses 0}} start {{index .PromptResponses 1}}" context: 'localBranches' loadingText: 'creating branch' + - key : 'r' + description: 'Checkout a remote branch as FETCH_HEAD' + command: "git fetch {{index .PromptResponses 0}} {{index .PromptResponses 1}} && git checkout FETCH_HEAD" + context: 'remotes' + prompts: + - type: 'input' + title: 'Remote:' + initialValue: "{{index .SelectedRemote.Name }}" + - type: 'menuFromCommand' + title: 'Remote branch:' + command: 'git branch -r --list {{index .PromptResponses 0}}/*' + filter: '.*{{index .PromptResponses 0}}/(.*)' ``` Looking at the command assigned to the 'n' key, here's what the result looks like: @@ -85,6 +97,10 @@ The permitted prompt fields are: | title | the title to display in the popup panel | no | | initialValue | (only applicable to 'input' prompts) the initial value to appear in the text box | no | | options | (only applicable to 'menu' prompts) the options to display in the menu | no | +| command | (only applicable to 'menuFromCommand' prompts) the command to run to generate | yes | +| | menu options | | +| filter | (only applicable to 'menuFromCommand' prompts) the regexp to run specify groups | yes | +| | which are going to be kept from the command's output | | The permitted option fields are: | _field_ | _description_ | _required_ | -- cgit v1.2.3