cmd_opt.h 668 Bytes
Newer Older
1
2
3
/*
 * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 */

#ifndef CMD_OPT_H_
#define CMD_OPT_H_

#include <getopt.h>

#define CMD_OPT_MAX_NUM			64

/* Supported long command line option types */
enum {
	CMD_OPT_CERT,
	CMD_OPT_KEY,
	CMD_OPT_EXT
};

21
22
23
24
25
26
/* Structure to define a command line option */
typedef struct cmd_opt_s {
	struct option long_opt;
	const char *help_msg;
} cmd_opt_t;

27
/* Exported API*/
28
void cmd_opt_add(const cmd_opt_t *cmd_opt);
29
30
const struct option *cmd_opt_get_array(void);
const char *cmd_opt_get_name(int idx);
31
const char *cmd_opt_get_help_msg(int idx);
32
33

#endif /* CMD_OPT_H_ */