cmd_opt.h 695 B

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