For now the completion does the correct thing of completing a local path
if NULL is returned.
Introduce 'virshCompletePathLocalExisting' and use it in the
'VIRSH_COMMON_OPT_FILE' macro.
This for now serves as an annotation for the function which want to read
a file on the host running virsh. In the future this can be used with a
more sophisticated implementation.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
return g_steal_pointer(&ret);
}
+
+
+/**
+ * virshCompletePathLocalExisting:
+ *
+ * Complete a path to a existing file used as input. The file is used as input
+ * for virsh so only local files are considered.
+ *
+ * Note: For now this is a no-op. Readline does the correct thing.
+ */
+char **
+virshCompletePathLocalExisting(vshControl *ctl G_GNUC_UNUSED,
+ const vshCmd *cmd G_GNUC_UNUSED,
+ unsigned int completerflags G_GNUC_UNUSED)
+{
+ return NULL;
+}
char **
virshCommaStringListComplete(const char *input,
const char **options);
+
+char **
+virshCompletePathLocalExisting(vshControl *ctl,
+ const vshCmd *cmd,
+ unsigned int completerflags);
{.name = "file", \
.type = VSH_OT_DATA, \
.flags = VSH_OFLAG_REQ, \
+ .completer = virshCompletePathLocalExisting, \
.help = _helpstr \
}