Skip to content

Commit

Permalink
IH-676: Add a Ctrl-r+q shortcut to insert names of required xe parame…
Browse files Browse the repository at this point in the history
…ters

```
$ xe vdi-create <Ctrl-r><q>

$ xe vdi-create sr-uuid= name-label= virtual-size=
```

Signed-off-by: Andrii Sultanov <[email protected]>
  • Loading branch information
last-genius authored and lindig committed Aug 23, 2024
1 parent 8704c79 commit 83f4397
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ocaml/xe-cli/bash-completion
Original file line number Diff line number Diff line change
Expand Up @@ -851,3 +851,16 @@ set_completions()
}

complete -F _xe -o nospace xe

__autocomplete_reqd_params_names()
{
local argv=( $READLINE_LINE )

local reqd_params=$(xe help "${argv[1]}" 2>/dev/null | grep '^[^:]*reqd params')
reqd_params=$(__process_params "$reqd_params")
echo "reqd params: ${reqd_params//,/ }" >> ce.debug
READLINE_LINE+="${reqd_params//,/ }"
return 0
}

bind -x '"\C-rq":"__autocomplete_reqd_params_names"'

0 comments on commit 83f4397

Please sign in to comment.