mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 07:38:20 +02:00
cli: add boolean value completion helper
This commit is contained in:
parent
e2fe0eeb18
commit
1e582f0172
2 changed files with 16 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue