|
18 | 18 | #define TOTP_CLI_COMMAND_ARG_SECRET_ENCODING_PREFIX "-e"
|
19 | 19 | #define TOTP_CLI_COMMAND_ARG_SECRET_ENCODING "encoding"
|
20 | 20 |
|
| 21 | +/** |
| 22 | + * @brief Prints information about unknown argument |
| 23 | + * @param arg |
| 24 | + */ |
21 | 25 | void totp_cli_printf_unknown_argument(const FuriString* arg);
|
22 | 26 |
|
| 27 | +/** |
| 28 | + * @brief Prints information about missed required argument |
| 29 | + * @param arg |
| 30 | + */ |
23 | 31 | void totp_cli_printf_missed_argument_value(char* arg);
|
24 | 32 |
|
| 33 | +/** |
| 34 | + * @brief Tries to read token hashing algo |
| 35 | + * @param token_info token info to set parsed algo to if successfully read and parsed |
| 36 | + * @param arg argument to parse |
| 37 | + * @param args rest of arguments |
| 38 | + * @param[out] parsed will be set to \c true if token hashing algo sucecssfully read and parsed; \c false otherwise |
| 39 | + * @return \c true if \c arg represents token hashing algo argument; \c false otherwise |
| 40 | + */ |
25 | 41 | bool totp_cli_try_read_algo(TokenInfo* token_info, FuriString* arg, FuriString* args, bool* parsed);
|
26 | 42 |
|
| 43 | +/** |
| 44 | + * @brief Tries to read token digits count |
| 45 | + * @param token_info token info to set parsed digits count to if successfully read and parsed |
| 46 | + * @param arg argument to parse |
| 47 | + * @param args rest of arguments |
| 48 | + * @param[out] parsed will be set to \c true if token digits count sucecssfully read and parsed; \c false otherwise |
| 49 | + * @return \c true if \c arg represents token digits count argument; \c false otherwise |
| 50 | + */ |
27 | 51 | bool totp_cli_try_read_digits(
|
28 | 52 | TokenInfo* token_info,
|
29 | 53 | const FuriString* arg,
|
30 | 54 | FuriString* args,
|
31 | 55 | bool* parsed);
|
32 | 56 |
|
| 57 | +/** |
| 58 | + * @brief Tries to read token duration |
| 59 | + * @param token_info token info to set parsed duration to if successfully read and parsed |
| 60 | + * @param arg argument to parse |
| 61 | + * @param args rest of arguments |
| 62 | + * @param[out] parsed will be set to \c true if token duration sucecssfully read and parsed; \c false otherwise |
| 63 | + * @return \c true if \c arg represents token duration argument; \c false otherwise |
| 64 | + */ |
33 | 65 | bool totp_cli_try_read_duration(
|
34 | 66 | TokenInfo* token_info,
|
35 | 67 | const FuriString* arg,
|
36 | 68 | FuriString* args,
|
37 | 69 | bool* parsed);
|
38 | 70 |
|
| 71 | +/** |
| 72 | + * @brief Tries to read token automation features |
| 73 | + * @param token_info token info to set parsed automation features to if successfully read and parsed |
| 74 | + * @param arg argument to parse |
| 75 | + * @param args rest of arguments |
| 76 | + * @param[out] parsed will be set to \c true if token automation features sucecssfully read and parsed; \c false otherwise |
| 77 | + * @return \c true if \c arg represents token automation features argument; \c false otherwise |
| 78 | + */ |
39 | 79 | bool totp_cli_try_read_automation_features(
|
40 | 80 | TokenInfo* token_info,
|
41 | 81 | FuriString* arg,
|
42 | 82 | FuriString* args,
|
43 | 83 | bool* parsed);
|
44 | 84 |
|
| 85 | +/** |
| 86 | + * @brief Tries to read unsecure flag |
| 87 | + * @param arg argument to parse |
| 88 | + * @param[out] parsed will be set to \c true if unsecure flag sucecssfully read and parsed; \c false otherwise |
| 89 | + * @param[out] unsecure_flag will be set to parsed unsecure flag state if read and parsed successfully |
| 90 | + * @return \c true if \c arg represents unsecure flag argument; \c false otherwise |
| 91 | + */ |
45 | 92 | bool totp_cli_try_read_unsecure_flag(const FuriString* arg, bool* parsed, bool* unsecure_flag);
|
46 | 93 |
|
| 94 | +/** |
| 95 | + * @brief Tries to read plain token secret encoding |
| 96 | + * @param arg argument to parse |
| 97 | + * @param args rest of arguments |
| 98 | + * @param[out] parsed will be set to \c true if plain token secret encoding sucecssfully read and parsed; \c false otherwise |
| 99 | + * @param[out] secret_encoding will be set to parsed plain token secret encoding if read and parsed successfully |
| 100 | + * @return \c true if \c arg represents plain token secret encoding argument; \c false otherwise |
| 101 | + */ |
47 | 102 | bool totp_cli_try_read_plain_token_secret_encoding(
|
48 | 103 | FuriString* arg,
|
49 | 104 | FuriString* args,
|
|
0 commit comments