diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 0f177fb69a..613226ab89 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -2629,6 +2629,7 @@ static const vshCmdOptDef opts_blockcopy[] = { {.name = "dest", .type = VSH_OT_STRING, .unwanted_positional = true, + .completer = vshCompletePathLocalCreate, .help = N_("path of the copy to create") }, {.name = "bandwidth", @@ -4651,6 +4652,7 @@ static const vshCmdOptDef opts_save[] = { .type = VSH_OT_STRING, .positional = true, .required = true, + .completer = vshCompletePathLocalCreate, .help = N_("where to save the data") }, {.name = "bypass-cache", @@ -5911,6 +5913,7 @@ static const vshCmdOptDef opts_dump[] = { .type = VSH_OT_STRING, .positional = true, .required = true, + .completer = vshCompletePathLocalCreate, .help = N_("where to dump the core") }, VIRSH_COMMON_OPT_LIVE(N_("perform a live core dump if supported")), @@ -6081,7 +6084,7 @@ static const vshCmdOptDef opts_screenshot[] = { {.name = "file", .type = VSH_OT_STRING, .unwanted_positional = true, - .completer = vshCompletePathLocalExisting, + .completer = vshCompletePathLocalCreate, .help = N_("where to store the screenshot") }, {.name = "screen", diff --git a/tools/vsh-completer.c b/tools/vsh-completer.c index 8f0376879c..16fa692900 100644 --- a/tools/vsh-completer.c +++ b/tools/vsh-completer.c @@ -172,6 +172,23 @@ vshCompletePathLocalExisting(vshControl *ctl G_GNUC_UNUSED, } +/** + * vshCompletePathLocalCreate: + * + * Complete a path to local file used as output. + * The outout file may not exist yet. + * + * Note: For now this is a no-op. + */ +char ** +vshCompletePathLocalCreate(vshControl *ctl G_GNUC_UNUSED, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int completerflags G_GNUC_UNUSED) +{ + return NULL; +} + + /** * vshCompleteEmpty: * diff --git a/tools/vsh-completer.h b/tools/vsh-completer.h index b479156062..5639974c0b 100644 --- a/tools/vsh-completer.h +++ b/tools/vsh-completer.h @@ -35,6 +35,11 @@ vshCompletePathLocalExisting(vshControl *ctl, const vshCmd *cmd, unsigned int completerflags); +char ** +vshCompletePathLocalCreate(vshControl *ctl, + const vshCmd *cmd, + unsigned int completerflags); + char ** vshCompleteEmpty(vshControl *ctl, const vshCmd *cmd,