mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
vsh: Introduce complete command
This command is going to be called from bash completion script in the following form: virsh complete -- start --domain Its only purpose is to return list of possible strings for completion. Note that this is a 'hidden', unlisted command and therefore there's no documentation to it. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
14
tools/vsh.h
14
tools/vsh.h
@@ -382,6 +382,8 @@ extern const vshCmdInfo info_echo[];
|
||||
extern const vshCmdInfo info_pwd[];
|
||||
extern const vshCmdInfo info_quit[];
|
||||
extern const vshCmdInfo info_selftest[];
|
||||
extern const vshCmdOptDef opts_complete[];
|
||||
extern const vshCmdInfo info_complete[];
|
||||
|
||||
bool cmdHelp(vshControl *ctl, const vshCmd *cmd);
|
||||
bool cmdCd(vshControl *ctl, const vshCmd *cmd);
|
||||
@@ -389,6 +391,7 @@ bool cmdEcho(vshControl *ctl, const vshCmd *cmd);
|
||||
bool cmdPwd(vshControl *ctl, const vshCmd *cmd);
|
||||
bool cmdQuit(vshControl *ctl, const vshCmd *cmd);
|
||||
bool cmdSelfTest(vshControl *ctl, const vshCmd *cmd);
|
||||
bool cmdComplete(vshControl *ctl, const vshCmd *cmd);
|
||||
|
||||
# define VSH_CMD_CD \
|
||||
{ \
|
||||
@@ -454,6 +457,17 @@ bool cmdSelfTest(vshControl *ctl, const vshCmd *cmd);
|
||||
.alias = "self-test" \
|
||||
}
|
||||
|
||||
# define VSH_CMD_COMPLETE \
|
||||
{ \
|
||||
.name = "complete", \
|
||||
.handler = cmdComplete, \
|
||||
.opts = opts_complete, \
|
||||
.info = info_complete, \
|
||||
.flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_ALIAS, \
|
||||
.alias = "complete" \
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* readline */
|
||||
char * vshReadline(vshControl *ctl, const char *prompt);
|
||||
|
||||
Reference in New Issue
Block a user