help.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "help.h"
  2. #include "../../cli_helpers.h"
  3. #include "../add/add.h"
  4. #include "../delete/delete.h"
  5. #include "../list/list.h"
  6. #include "../timezone/timezone.h"
  7. void totp_cli_command_help_docopt_commands() {
  8. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_HELP ", " TOTP_CLI_COMMAND_HELP_ALT
  9. ", " TOTP_CLI_COMMAND_HELP_ALT2 " Show command usage help\r\n");
  10. }
  11. void totp_cli_command_help_docopt_usage() {
  12. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED(
  13. TOTP_CLI_COMMAND_HELP " | " TOTP_CLI_COMMAND_HELP_ALT
  14. " | " TOTP_CLI_COMMAND_HELP_ALT2) "\r\n");
  15. }
  16. void totp_cli_command_help_handle() {
  17. TOTP_CLI_PRINTF("Usage:\r\n");
  18. totp_cli_command_help_docopt_usage();
  19. totp_cli_command_list_docopt_usage();
  20. totp_cli_command_add_docopt_usage();
  21. totp_cli_command_delete_docopt_usage();
  22. totp_cli_command_timezone_docopt_usage();
  23. cli_nl();
  24. TOTP_CLI_PRINTF("Commands:\r\n");
  25. totp_cli_command_help_docopt_commands();
  26. totp_cli_command_list_docopt_commands();
  27. totp_cli_command_add_docopt_commands();
  28. totp_cli_command_delete_docopt_commands();
  29. totp_cli_command_timezone_docopt_commands();
  30. cli_nl();
  31. TOTP_CLI_PRINTF("Arguments:\r\n");
  32. totp_cli_command_add_docopt_arguments();
  33. totp_cli_command_delete_docopt_arguments();
  34. totp_cli_command_timezone_docopt_arguments();
  35. cli_nl();
  36. TOTP_CLI_PRINTF("Options:\r\n");
  37. totp_cli_command_add_docopt_options();
  38. totp_cli_command_delete_docopt_options();
  39. }