Skip to content

Commit

Permalink
Few more refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
akopachov committed Oct 25, 2022
1 parent a8f2ca0 commit 3a08fee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions services/cli/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "cli.h"
#include <lib/toolbox/args.h>
#include "cli_common_helpers.h"
#include "commands/list/list.h"
#include "commands/add/add.h"
#include "commands/delete/delete.h"
Expand All @@ -11,14 +12,14 @@
#define TOTP_CLI_COMMAND_HELP "help"

static void totp_cli_print_unknown_command(FuriString* unknown_command) {
printf("Command \"%s\" is unknown. Use \"help\" command to get list of available commands.", furi_string_get_cstr(unknown_command));
TOTP_CLI_PRINTF("Command \"%s\" is unknown. Use \"help\" command to get list of available commands.", furi_string_get_cstr(unknown_command));
}

static void totp_cli_print_help() {
printf("Usage:\r\n");
printf(TOTP_CLI_COMMAND_NAME " <command> <arguments>\r\n");
printf("Command list:\r\n");
printf("\t" TOTP_CLI_COMMAND_HELP " - print command usage help\r\n\r\n");
TOTP_CLI_PRINTF("Usage:\r\n");
TOTP_CLI_PRINTF(TOTP_CLI_COMMAND_NAME " <command> <arguments>\r\n");
TOTP_CLI_PRINTF("Command list:\r\n");
TOTP_CLI_PRINTF("\t" TOTP_CLI_COMMAND_HELP " - print command usage help\r\n\r\n");
totp_cli_command_list_print_help();
totp_cli_command_delete_print_help();
totp_cli_command_add_print_help();
Expand Down
2 changes: 1 addition & 1 deletion services/cli/cli_common_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <cli/cli.h>

void totp_cli_print_invalid_arguments() {
printf("Invalid command arguments. use \"help\" command to get list of available commands");
TOTP_CLI_PRINTF("Invalid command arguments. use \"help\" command to get list of available commands");
}

bool totp_cli_ensure_authenticated(PluginState* plugin_state, Cli* cli) {
Expand Down

0 comments on commit 3a08fee

Please sign in to comment.