diff options
Diffstat (limited to 'qemu-common.h')
-rw-r--r-- | qemu-common.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/qemu-common.h b/qemu-common.h index d26ff39e87..dd91912024 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -136,6 +136,24 @@ int qemu_main(int argc, char **argv, char **envp); void qemu_get_timedate(struct tm *tm, int offset); int qemu_timedate_diff(struct tm *tm); +/** + * is_help_option: + * @s: string to test + * + * Check whether @s is one of the standard strings which indicate + * that the user is asking for a list of the valid values for a + * command option like -cpu or -M. The current accepted strings + * are 'help' and '?'. '?' is deprecated (it is a shell wildcard + * which makes it annoying to use in a reliable way) but provided + * for backwards compatibility. + * + * Returns: true if @s is a request for a list. + */ +static inline bool is_help_option(const char *s) +{ + return !strcmp(s, "?") || !strcmp(s, "help"); +} + /* cutils.c */ void pstrcpy(char *buf, int buf_size, const char *str); void strpadcpy(char *buf, int buf_size, const char *str, char pad); |