version.c 891 B

12345678910111213141516171819202122232425262728293031
  1. #include <flipper_application/flipper_application.h>
  2. #include "../../cli_helpers.h"
  3. #include "../../cli_plugin_interface.h"
  4. #include "../../../version.h"
  5. static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
  6. UNUSED(args);
  7. UNUSED(cli);
  8. UNUSED(plugin_state);
  9. TOTP_CLI_PRINTF(
  10. "%" PRIu8 ".%" PRIu8 ".%" PRIu8
  11. #ifdef TOTP_APP_VERSION_META
  12. "+" TOTP_APP_VERSION_META
  13. #endif
  14. "\r\n",
  15. TOTP_APP_VERSION_MAJOR,
  16. TOTP_APP_VERSION_MINOR,
  17. TOTP_APP_VERSION_PATCH);
  18. }
  19. static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Version", .handle = &handle};
  20. static const FlipperAppPluginDescriptor plugin_descriptor = {
  21. .appid = PLUGIN_APP_ID,
  22. .ep_api_version = PLUGIN_API_VERSION,
  23. .entry_point = &plugin,
  24. };
  25. const FlipperAppPluginDescriptor* totp_cli_version_plugin_ep() {
  26. return &plugin_descriptor;
  27. }