help.c 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #include "help.h"
  2. #include "../../cli_helpers.h"
  3. #include "../add/add.h"
  4. #include "../update/update.h"
  5. #include "../delete/delete.h"
  6. #include "../list/list.h"
  7. #include "../timezone/timezone.h"
  8. #include "../move/move.h"
  9. #include "../pin/pin.h"
  10. #include "../notification/notification.h"
  11. #include "../reset/reset.h"
  12. #include "../automation/automation.h"
  13. #include "../details/details.h"
  14. #ifdef TOTP_CLI_RICH_HELP_ENABLED
  15. void totp_cli_command_help_docopt_commands() {
  16. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_HELP ", " TOTP_CLI_COMMAND_HELP_ALT
  17. ", " TOTP_CLI_COMMAND_HELP_ALT2 " Show command usage help\r\n");
  18. }
  19. void totp_cli_command_help_docopt_usage() {
  20. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED(
  21. TOTP_CLI_COMMAND_HELP " | " TOTP_CLI_COMMAND_HELP_ALT
  22. " | " TOTP_CLI_COMMAND_HELP_ALT2) "\r\n");
  23. }
  24. #endif
  25. void totp_cli_command_help_handle() {
  26. #ifdef TOTP_CLI_RICH_HELP_ENABLED
  27. TOTP_CLI_PRINTF("Usage:\r\n");
  28. totp_cli_command_help_docopt_usage();
  29. totp_cli_command_list_docopt_usage();
  30. totp_cli_command_details_docopt_usage();
  31. totp_cli_command_add_docopt_usage();
  32. totp_cli_command_update_docopt_usage();
  33. totp_cli_command_delete_docopt_usage();
  34. totp_cli_command_timezone_docopt_usage();
  35. totp_cli_command_move_docopt_usage();
  36. totp_cli_command_pin_docopt_usage();
  37. totp_cli_command_notification_docopt_usage();
  38. totp_cli_command_reset_docopt_usage();
  39. totp_cli_command_automation_docopt_usage();
  40. cli_nl();
  41. TOTP_CLI_PRINTF("Commands:\r\n");
  42. totp_cli_command_help_docopt_commands();
  43. totp_cli_command_list_docopt_commands();
  44. totp_cli_command_details_docopt_commands();
  45. totp_cli_command_add_docopt_commands();
  46. totp_cli_command_update_docopt_commands();
  47. totp_cli_command_delete_docopt_commands();
  48. totp_cli_command_timezone_docopt_commands();
  49. totp_cli_command_move_docopt_commands();
  50. totp_cli_command_pin_docopt_commands();
  51. totp_cli_command_notification_docopt_commands();
  52. totp_cli_command_reset_docopt_commands();
  53. totp_cli_command_automation_docopt_commands();
  54. cli_nl();
  55. TOTP_CLI_PRINTF("Arguments:\r\n");
  56. totp_cli_command_add_docopt_arguments();
  57. totp_cli_command_delete_docopt_arguments();
  58. totp_cli_command_move_docopt_arguments();
  59. totp_cli_command_timezone_docopt_arguments();
  60. totp_cli_command_notification_docopt_arguments();
  61. totp_cli_command_automation_docopt_arguments();
  62. cli_nl();
  63. TOTP_CLI_PRINTF("Options:\r\n");
  64. totp_cli_command_add_docopt_options();
  65. totp_cli_command_update_docopt_options();
  66. totp_cli_command_delete_docopt_options();
  67. totp_cli_command_pin_docopt_options();
  68. totp_cli_command_automation_docopt_options();
  69. #else
  70. TOTP_CLI_PRINTF(
  71. "All the TOTP CLI commands, their arguments, options and usage can be found here https://t.ly/_6pJG");
  72. #endif
  73. }