summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
Diffstat (limited to 'clients')
-rw-r--r--clients/cli/common.c14
-rw-r--r--clients/cli/common.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c
index 6c7a6dc46b..fc2245cbd1 100644
--- a/clients/cli/common.c
+++ b/clients/cli/common.c
@@ -1464,3 +1464,17 @@ nmc_complete_strings (const char *prefix, ...)
}
va_end (args);
}
+
+/**
+ * nmc_complete_bool:
+ * @prefix: a string to match
+ * @...: a %NULL-terminated list of candidate strings
+ *
+ * Prints all the matching possible boolean values for completion.
+ */
+void
+nmc_complete_bool (const char *prefix)
+{
+ nmc_complete_strings (prefix, "true", "yes", "on",
+ "false", "no", "off", NULL);
+}
diff --git a/clients/cli/common.h b/clients/cli/common.h
index eacd20eb44..3910683dc5 100644
--- a/clients/cli/common.h
+++ b/clients/cli/common.h
@@ -83,4 +83,6 @@ NMCResultCode nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *argv0
void nmc_complete_strings (const char *prefix, ...) G_GNUC_NULL_TERMINATED;
+void nmc_complete_bool (const char *prefix);
+
#endif /* NMC_COMMON_H */