blob: 5095ed16864fd27e524c96b51be1866167483cd1 [file] [log] [blame]
Juan Castillo1218dd52015-07-03 16:23:16 +01001/*
2 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Juan Castillo1218dd52015-07-03 16:23:16 +01005 */
6
7#ifndef CMD_OPT_H_
8#define CMD_OPT_H_
9
10#include <getopt.h>
11
12#define CMD_OPT_MAX_NUM 64
13
14/* Supported long command line option types */
15enum {
16 CMD_OPT_CERT,
17 CMD_OPT_KEY,
18 CMD_OPT_EXT
19};
20
Juan Castillo212f7382015-12-15 16:37:57 +000021/* Structure to define a command line option */
22typedef struct cmd_opt_s {
23 struct option long_opt;
24 const char *help_msg;
25} cmd_opt_t;
26
Juan Castillo1218dd52015-07-03 16:23:16 +010027/* Exported API*/
Juan Castillo212f7382015-12-15 16:37:57 +000028void cmd_opt_add(const cmd_opt_t *cmd_opt);
Juan Castillo1218dd52015-07-03 16:23:16 +010029const struct option *cmd_opt_get_array(void);
30const char *cmd_opt_get_name(int idx);
Juan Castillo212f7382015-12-15 16:37:57 +000031const char *cmd_opt_get_help_msg(int idx);
Juan Castillo1218dd52015-07-03 16:23:16 +010032
33#endif /* CMD_OPT_H_ */