diff options
author | Thomas Haller <thaller@redhat.com> | 2019-03-01 08:55:30 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-03-07 22:22:39 +0100 |
commit | c5a247c4c081836f5995674a20a55f3266cabd2b (patch) | |
tree | 950838e3b19db7cba8f43bf51bbca2a0e561416b /clients/cli/common.h | |
parent | a695acfd289a3d1af2782e8b3c37c760e8434008 (diff) | |
download | NetworkManager-c5a247c4c081836f5995674a20a55f3266cabd2b.tar.gz |
cli: add nmc_complete_strv() which takes a string array for completion that may contain NULL
This will allow for a convenient calling pattern when some elements
should be printed optionally.
(cherry picked from commit 62b939de4e2288d0a9d305706db4cf47c34122d5)
Diffstat (limited to 'clients/cli/common.h')
-rw-r--r-- | clients/cli/common.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clients/cli/common.h b/clients/cli/common.h index 71734acc98..688f2819f6 100644 --- a/clients/cli/common.h +++ b/clients/cli/common.h @@ -88,7 +88,9 @@ typedef struct { void nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char **argv); -void nmc_complete_strings (const char *prefix, ...) G_GNUC_NULL_TERMINATED; +void nmc_complete_strv (const char *prefix, gssize nargs, const char *const*args); + +#define nmc_complete_strings(prefix, ...) nmc_complete_strv ((prefix), NM_NARG (__VA_ARGS__), (const char *const[]) { __VA_ARGS__ }) void nmc_complete_bool (const char *prefix); |