Skip to content

Commit 3a08fee

Browse files
committed
Few more refactoring
1 parent a8f2ca0 commit 3a08fee

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

services/cli/cli.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "cli.h"
44
#include <lib/toolbox/args.h>
5+
#include "cli_common_helpers.h"
56
#include "commands/list/list.h"
67
#include "commands/add/add.h"
78
#include "commands/delete/delete.h"
@@ -11,14 +12,14 @@
1112
#define TOTP_CLI_COMMAND_HELP "help"
1213

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

1718
static void totp_cli_print_help() {
18-
printf("Usage:\r\n");
19-
printf(TOTP_CLI_COMMAND_NAME " <command> <arguments>\r\n");
20-
printf("Command list:\r\n");
21-
printf("\t" TOTP_CLI_COMMAND_HELP " - print command usage help\r\n\r\n");
19+
TOTP_CLI_PRINTF("Usage:\r\n");
20+
TOTP_CLI_PRINTF(TOTP_CLI_COMMAND_NAME " <command> <arguments>\r\n");
21+
TOTP_CLI_PRINTF("Command list:\r\n");
22+
TOTP_CLI_PRINTF("\t" TOTP_CLI_COMMAND_HELP " - print command usage help\r\n\r\n");
2223
totp_cli_command_list_print_help();
2324
totp_cli_command_delete_print_help();
2425
totp_cli_command_add_print_help();

services/cli/cli_common_helpers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include <cli/cli.h>
33

44
void totp_cli_print_invalid_arguments() {
5-
printf("Invalid command arguments. use \"help\" command to get list of available commands");
5+
TOTP_CLI_PRINTF("Invalid command arguments. use \"help\" command to get list of available commands");
66
}
77

88
bool totp_cli_ensure_authenticated(PluginState* plugin_state, Cli* cli) {

0 commit comments

Comments
 (0)