xref: /openbmc/openpower-hw-diags/cli.hpp (revision b859d79a)
1 #pragma once
2 
3 #include <attn/attn_config.hpp>
4 
5 #include <string>
6 
7 /*
8  * @brief Search the command line arguments for an option
9  *
10  * @param i_begin   command line args vector begin
11  * @param i_end     command line args vector end
12  * @param i_option  configuration option to look for
13  *
14  * @return true = option found on command line
15  */
16 bool getCliOption(char** i_begin, char** i_end, const std::string& i_option);
17 
18 /*
19  * @brief Search the command line arguments for a setting value
20  *
21  * @param i_begin   command line args vector begin
22  * @param i_end     command line args vectory end
23  * @param i_setting configuration setting to look for
24  *
25  * @return value of the setting or 0 if setting not found or value not given
26  */
27 char* getCliSetting(char** i_begin, char** i_end, const std::string& i_setting);
28 
29 /*
30  *
31  * @brief Get configuration flags from command line
32  *
33  * Parse the command line for configuration options and update the
34  * attention handler configuration object as needed.
35  *
36  * @param i_begin       command line args vector begin
37  * @param i_end         command line args vector end
38  * @param o_config      pointer to attention handler configuration object
39  */
40 void parseConfig(char** i_begin, char** i_end, attn::Config* o_config);
41