version.c 900 B

1234567891011121314151617181920212223242526272829303132
  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. "+"
  13. TOTP_APP_VERSION_META
  14. #endif
  15. "\r\n",
  16. TOTP_APP_VERSION_MAJOR,
  17. TOTP_APP_VERSION_MINOR,
  18. TOTP_APP_VERSION_PATCH);
  19. }
  20. static const CliPlugin plugin = {.name = "TOTP CLI Plugin: Version", .handle = &handle};
  21. static const FlipperAppPluginDescriptor plugin_descriptor = {
  22. .appid = PLUGIN_APP_ID,
  23. .ep_api_version = PLUGIN_API_VERSION,
  24. .entry_point = &plugin,
  25. };
  26. const FlipperAppPluginDescriptor* totp_cli_version_plugin_ep() {
  27. return &plugin_descriptor;
  28. }