Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 5 | */ |
| 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 */ |
| 15 | enum { |
| 16 | CMD_OPT_CERT, |
| 17 | CMD_OPT_KEY, |
| 18 | CMD_OPT_EXT |
| 19 | }; |
| 20 | |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 21 | /* Structure to define a command line option */ |
| 22 | typedef struct cmd_opt_s { |
| 23 | struct option long_opt; |
| 24 | const char *help_msg; |
| 25 | } cmd_opt_t; |
| 26 | |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 27 | /* Exported API*/ |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 28 | void cmd_opt_add(const cmd_opt_t *cmd_opt); |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 29 | const struct option *cmd_opt_get_array(void); |
| 30 | const char *cmd_opt_get_name(int idx); |
Juan Castillo | 212f738 | 2015-12-15 16:37:57 +0000 | [diff] [blame] | 31 | const char *cmd_opt_get_help_msg(int idx); |
Juan Castillo | 1218dd5 | 2015-07-03 16:23:16 +0100 | [diff] [blame] | 32 | |
| 33 | #endif /* CMD_OPT_H_ */ |