@@ -115,10 +115,10 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
115115 bool parsed = false;
116116 if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX ) == 0 ) {
117117 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" );
120120 } else if (!token_info_set_algo_from_str (token_info , temp_str )) {
121- TOTP_CLI_PRINTF (
121+ TOTP_CLI_PRINTF_ERROR (
122122 "\"%s\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_ALGO_PREFIX
123123 "\"\r\n" ,
124124 furi_string_get_cstr (temp_str ));
@@ -128,11 +128,11 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
128128 } else if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX ) == 0 ) {
129129 uint8_t digit_value ;
130130 if (!args_read_uint8_and_trim (args , & digit_value )) {
131- TOTP_CLI_PRINTF (
131+ TOTP_CLI_PRINTF_ERROR (
132132 "Missed or incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
133133 "\"\r\n" );
134134 } else if (!token_info_set_digits_from_int (token_info , digit_value )) {
135- TOTP_CLI_PRINTF (
135+ TOTP_CLI_PRINTF_ERROR (
136136 "\"%" PRIu8
137137 "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DIGITS_PREFIX
138138 "\"\r\n" ,
@@ -143,11 +143,11 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
143143 } else if (furi_string_cmpi_str (temp_str , TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX ) == 0 ) {
144144 uint8_t duration_value ;
145145 if (!args_read_uint8_and_trim (args , & duration_value )) {
146- TOTP_CLI_PRINTF (
146+ TOTP_CLI_PRINTF_ERROR (
147147 "Missed or incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
148148 "\"\r\n" );
149149 } else if (!token_info_set_duration_from_int (token_info , duration_value )) {
150- TOTP_CLI_PRINTF (
150+ TOTP_CLI_PRINTF_ERROR (
151151 "\"%" PRIu8
152152 "\" is incorrect value for argument \"" TOTP_CLI_COMMAND_ADD_ARG_DURATION_PREFIX
153153 "\"\r\n" ,
@@ -159,7 +159,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
159159 mask_user_input = false;
160160 parsed = true;
161161 } 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 ));
163163 }
164164
165165 if (!parsed ) {
@@ -176,7 +176,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
176176 if (!totp_cli_read_line (cli , temp_str , mask_user_input ) ||
177177 !totp_cli_ensure_authenticated (plugin_state , cli )) {
178178 TOTP_CLI_DELETE_LAST_LINE ();
179- TOTP_CLI_PRINTF ("Cancelled by user\r\n" );
179+ TOTP_CLI_PRINTF_INFO ("Cancelled by user\r\n" );
180180 furi_string_secure_free (temp_str );
181181 token_info_free (token_info );
182182 return ;
@@ -189,7 +189,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
189189 furi_string_get_cstr (temp_str ),
190190 furi_string_size (temp_str ),
191191 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" );
193193 furi_string_secure_free (temp_str );
194194 token_info_free (token_info );
195195 return ;
@@ -206,7 +206,7 @@ void totp_cli_command_add_handle(PluginState* plugin_state, FuriString* args, Cl
206206 TOTP_LIST_INIT_OR_ADD (plugin_state -> tokens_list , token_info , furi_check );
207207 plugin_state -> tokens_count ++ ;
208208 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 );
210210 } else {
211211 TOTP_CLI_PRINT_ERROR_UPDATING_CONFIG_FILE ();
212212 }
0 commit comments