1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation.
9 #include <rte_option.h>
11 #include "eal_private.h"
13 TAILQ_HEAD(rte_option_list, rte_option);
15 struct rte_option_list rte_option_list =
16 TAILQ_HEAD_INITIALIZER(rte_option_list);
19 rte_option_parse(const char *opt)
21 struct rte_option *option;
23 if (strlen(opt) <= 2 ||
24 strncmp(opt, "--", 2))
27 /* Check if the option is registered */
28 TAILQ_FOREACH(option, &rte_option_list, next) {
29 if (strcmp(&opt[2], option->name) == 0) {
38 void __rte_experimental
39 rte_option_register(struct rte_option *opt)
41 struct rte_option *option;
43 TAILQ_FOREACH(option, &rte_option_list, next) {
44 if (strcmp(opt->name, option->name) == 0) {
45 RTE_LOG(INFO, EAL, "Option %s has already been registered.\n",
51 TAILQ_INSERT_HEAD(&rte_option_list, opt, next);
57 struct rte_option *option;
59 TAILQ_FOREACH(option, &rte_option_list, next) {
66 rte_option_usage(void)
68 struct rte_option *option;
71 TAILQ_FOREACH(option, &rte_option_list, next)
76 printf("EAL dynamic options:\n");
77 TAILQ_FOREACH(option, &rte_option_list, next)
78 printf(" --%-*s %s\n", 17, option->name, option->usage);