cmd_opt.h 665 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef CMD_OPT_H
  7. #define CMD_OPT_H
  8. #include <getopt.h>
  9. #define CMD_OPT_MAX_NUM 64
  10. /* Supported long command line option types */
  11. enum {
  12. CMD_OPT_CERT,
  13. CMD_OPT_KEY,
  14. CMD_OPT_EXT
  15. };
  16. /* Structure to define a command line option */
  17. typedef struct cmd_opt_s {
  18. struct option long_opt;
  19. const char *help_msg;
  20. } cmd_opt_t;
  21. /* Exported API*/
  22. void cmd_opt_add(const cmd_opt_t *cmd_opt);
  23. const struct option *cmd_opt_get_array(void);
  24. const char *cmd_opt_get_name(int idx);
  25. const char *cmd_opt_get_help_msg(int idx);
  26. #endif /* CMD_OPT_H */