help.c 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #include "../version/version.h"
  15. #ifdef TOTP_CLI_RICH_HELP_ENABLED
  16. void totp_cli_command_help_docopt_commands() {
  17. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_HELP ", " TOTP_CLI_COMMAND_HELP_ALT
  18. ", " TOTP_CLI_COMMAND_HELP_ALT2 " Show command usage help\r\n");
  19. }
  20. void totp_cli_command_help_docopt_usage() {
  21. TOTP_CLI_PRINTF(" " TOTP_CLI_COMMAND_NAME " " DOCOPT_REQUIRED(
  22. TOTP_CLI_COMMAND_HELP " | " TOTP_CLI_COMMAND_HELP_ALT
  23. " | " TOTP_CLI_COMMAND_HELP_ALT2) "\r\n");
  24. }
  25. #endif
  26. void totp_cli_command_help_handle() {
  27. #ifdef TOTP_CLI_RICH_HELP_ENABLED
  28. TOTP_CLI_PRINTF("Usage:\r\n");
  29. totp_cli_command_help_docopt_usage();
  30. totp_cli_command_version_docopt_usage();
  31. totp_cli_command_list_docopt_usage();
  32. totp_cli_command_details_docopt_usage();
  33. totp_cli_command_add_docopt_usage();
  34. totp_cli_command_update_docopt_usage();
  35. totp_cli_command_delete_docopt_usage();
  36. totp_cli_command_timezone_docopt_usage();
  37. totp_cli_command_move_docopt_usage();
  38. totp_cli_command_pin_docopt_usage();
  39. totp_cli_command_notification_docopt_usage();
  40. totp_cli_command_reset_docopt_usage();
  41. totp_cli_command_automation_docopt_usage();
  42. cli_nl();
  43. TOTP_CLI_PRINTF("Commands:\r\n");
  44. totp_cli_command_help_docopt_commands();
  45. totp_cli_command_version_docopt_commands();
  46. totp_cli_command_list_docopt_commands();
  47. totp_cli_command_details_docopt_commands();
  48. totp_cli_command_add_docopt_commands();
  49. totp_cli_command_update_docopt_commands();
  50. totp_cli_command_delete_docopt_commands();
  51. totp_cli_command_timezone_docopt_commands();
  52. totp_cli_command_move_docopt_commands();
  53. totp_cli_command_pin_docopt_commands();
  54. totp_cli_command_notification_docopt_commands();
  55. totp_cli_command_reset_docopt_commands();
  56. totp_cli_command_automation_docopt_commands();
  57. cli_nl();
  58. TOTP_CLI_PRINTF("Arguments:\r\n");
  59. totp_cli_command_add_docopt_arguments();
  60. totp_cli_command_delete_docopt_arguments();
  61. totp_cli_command_move_docopt_arguments();
  62. totp_cli_command_timezone_docopt_arguments();
  63. totp_cli_command_notification_docopt_arguments();
  64. totp_cli_command_automation_docopt_arguments();
  65. cli_nl();
  66. TOTP_CLI_PRINTF("Options:\r\n");
  67. totp_cli_command_add_docopt_options();
  68. totp_cli_command_update_docopt_options();
  69. totp_cli_command_delete_docopt_options();
  70. totp_cli_command_pin_docopt_options();
  71. totp_cli_command_automation_docopt_options();
  72. #else
  73. TOTP_CLI_PRINTF(
  74. "All the TOTP CLI commands, their arguments, options and usage can be found here https://t.ly/_6pJG");
  75. #endif
  76. }