]> git.proxmox.com Git - mirror_qemu.git/blame - include/qemu/help_option.h
Merge tag 'pull-loongarch-20231221' of https://gitlab.com/gaosong/qemu into staging
[mirror_qemu.git] / include / qemu / help_option.h
CommitLineData
f348b6d1 1#ifndef QEMU_HELP_OPTION_H
175de524 2#define QEMU_HELP_OPTION_H
f348b6d1
VB
3
4/**
5 * is_help_option:
6 * @s: string to test
7 *
8 * Check whether @s is one of the standard strings which indicate
9 * that the user is asking for a list of the valid values for a
10 * command option like -cpu or -M. The current accepted strings
11 * are 'help' and '?'. '?' is deprecated (it is a shell wildcard
12 * which makes it annoying to use in a reliable way) but provided
13 * for backwards compatibility.
14 *
15 * Returns: true if @s is a request for a list.
16 */
17static inline bool is_help_option(const char *s)
18{
19 return !strcmp(s, "?") || !strcmp(s, "help");
20}
21
8bf12c4f
KW
22static inline int starts_with_help_option(const char *s)
23{
24 if (*s == '?') {
25 return 1;
26 }
27 if (g_str_has_prefix(s, "help")) {
28 return 4;
29 }
30 return 0;
31}
32
f348b6d1 33#endif