Skip to content

Conversation

rosslagerwall
Copy link
Contributor

The shortcut to show required parameters is Ctrl-rq but this conflicts with the default readline shortcut for reverse-search-history. Usually, it finds the first match but subsequent presses of Ctrl-r do not find any further matches.

Fix this by switching to Meta-q (aka Alt-q or Esc-q) which is unused.

The shortcut to show required parameters is Ctrl-rq but this conflicts
with the default readline shortcut for reverse-search-history. Usually,
it finds the first match but subsequent presses of Ctrl-r do not find
any further matches.

Fix this by switching to Meta-q (aka Alt-q or Esc-q) which is unused.

Signed-off-by: Ross Lagerwall <[email protected]>
@freddy77
Copy link
Collaborator

Not sure if this is documented somewhere and we should update also the documentation.

@rosslagerwall
Copy link
Contributor Author

Not sure if this is documented somewhere and we should update also the documentation.

Not sure. It wasn't documented as part of the commit which introduced the shortcut.

Copy link
Member

@robhoes robhoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I noticed Ctrl-r didn't work properly, but didn't know that this was responsible... This change fixes it for me.

Copy link
Contributor

@edwintorok edwintorok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know we supported this.
An example command on which this work is xe vbd-create, which will print vm-uuid= device= after pressing the shortcut.
It doesn't work on xe vm-start, which does require a parameter, but there are multiple ways to specify a <vm-selector>

@edwintorok edwintorok added this pull request to the merge queue Jul 14, 2025
Merged via the queue into xapi-project:master with commit 11e9e2b Jul 14, 2025
16 checks passed
@last-genius
Copy link
Contributor

Damn, my apologies for breaking it, thanks for the fix!

I didn't document this at the time because I couldn't come up with the best place to document autocompletion as opposed to scriptable CLI behaviour.

@edwintorok the functionality is based on parsing the help docs, which do not specify any required params:

# xe help vm-start
command name            : vm-start
        reqd params     :
        optional params : force, on, paused, <vm-selectors>

@rosslagerwall rosslagerwall deleted the private/rossla/completion branch July 14, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants