@@ -115,10 +115,10 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
115
115
bool parsed = false;
116
116
if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX ) == 0 ) {
117
117
if (!args_read_string_and_trim (args , temp_str )) {
118
- TOTP_CLI_PRINTF ( "Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX
119
- "\"\r\n" );
118
+ TOTP_CLI_PRINTF_ERROR (
119
+ "Missed value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX "\"\r\n" );
120
120
} else if (!token_info_set_algo_from_str (token_info , temp_str )) {
121
- TOTP_CLI_PRINTF (
121
+ TOTP_CLI_PRINTF_ERROR (
122
122
"\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX
123
123
"\"\r\n" ,
124
124
furi_string_get_cstr (temp_str ));
@@ -128,11 +128,11 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
128
128
} else if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX ) == 0 ) {
129
129
uint8_t digit_value ;
130
130
if (!args_read_uint8_and_trim (args , & digit_value )) {
131
- TOTP_CLI_PRINTF (
131
+ TOTP_CLI_PRINTF_ERROR (
132
132
"Missed or incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
133
133
"\"\r\n" );
134
134
} else if (!token_info_set_digits_from_int (token_info , digit_value )) {
135
- TOTP_CLI_PRINTF (
135
+ TOTP_CLI_PRINTF_ERROR (
136
136
"\"%" PRIu8
137
137
"\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
138
138
"\"\r\n" ,
@@ -143,11 +143,11 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
143
143
} else if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX ) == 0 ) {
144
144
uint8_t duration_value ;
145
145
if (!args_read_uint8_and_trim (args , & duration_value )) {
146
- TOTP_CLI_PRINTF (
146
+ TOTP_CLI_PRINTF_ERROR (
147
147
"Missed or incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
148
148
"\"\r\n" );
149
149
} else if (!token_info_set_duration_from_int (token_info , duration_value )) {
150
- TOTP_CLI_PRINTF (
150
+ TOTP_CLI_PRINTF_ERROR (
151
151
"\"%" PRIu8
152
152
"\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
153
153
"\"\r\n" ,
@@ -159,7 +159,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
159
159
mask_user_input = false;
160
160
parsed = true;
161
161
} else {
162
- TOTP_CLI_PRINTF ("Unknown argument \"%s\"\r\n" , furi_string_get_cstr (temp_str ));
162
+ TOTP_CLI_PRINTF_ERROR ("Unknown argument \"%s\"\r\n" , furi_string_get_cstr (temp_str ));
163
163
}
164
164
165
165
if (!parsed ) {
@@ -176,7 +176,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
176
176
if (!totp_cli_read_line (cli , temp_str , mask_user_input ) ||
177
177
!totp_cli_ensure_authenticated (plugin_state , cli )) {
178
178
TOTP_CLI_DELETE_LAST_LINE ();
179
- TOTP_CLI_PRINTF ("Cancelled by user\r\n" );
179
+ TOTP_CLI_PRINTF_INFO ("Cancelled by user\r\n" );
180
180
furi_string_secure_free (temp_str );
181
181
token_info_free (token_info );
182
182
return ;
@@ -189,7 +189,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
189
189
furi_string_get_cstr (temp_str ),
190
190
furi_string_size (temp_str ),
191
191
plugin_state -> iv )) {
192
- TOTP_CLI_PRINTF ("Token secret seems to be invalid and can not be parsed\r\n" );
192
+ TOTP_CLI_PRINTF_ERROR ("Token secret seems to be invalid and can not be parsed\r\n" );
193
193
furi_string_secure_free (temp_str );
194
194
token_info_free (token_info );
195
195
return ;
@@ -206,7 +206,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
206
206
TOTP_LIST_INIT_OR_ADD (plugin_state -> tokens_list , token_info , furi_check );
207
207
plugin_state -> tokens_count ++ ;
208
208
if (totp_config_file_save_new_token (token_info ) == TotpConfigFileUpdateSuccess ) {
209
- TOTP_CLI_PRINTF ("Token \"%s\" has been successfully added\r\n" , token_info -> name );
209
+ TOTP_CLI_PRINTF_SUCCESS ("Token \"%s\" has been successfully added\r\n" , token_info -> name );
210
210
} else {
211
211
TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE ();
212
212
}
0 commit comments