@@ -128,6 +128,7 @@ pub fn get_matches() -> ArgMatches {
128
128
. long ( "index" )
129
129
. help ( "OTP Code index" )
130
130
. num_args ( 1 )
131
+ . value_parser ( value_parser ! ( usize ) )
131
132
. required ( true ) ,
132
133
)
133
134
. arg (
@@ -136,23 +137,23 @@ pub fn get_matches() -> ArgMatches {
136
137
. long ( "issuer" )
137
138
. help ( "OTP Code issuer" )
138
139
. num_args ( 1 )
139
- . required_unless_present_any ( [ "label" , "algorithm" , "digits" , "counter" ] ) ,
140
+ . required_unless_present_any ( [ "label" , "algorithm" , "digits" , "counter" , "pin" , "change-secret" ] ) ,
140
141
)
141
142
. arg (
142
143
Arg :: new ( "label" )
143
144
. short ( 'l' )
144
145
. long ( "label" )
145
146
. help ( "OTP Code label" )
146
147
. num_args ( 1 )
147
- . required_unless_present_any ( [ "issuer" , "algorithm" , "digits" , "counter" ] ) ,
148
+ . required_unless_present_any ( [ "issuer" , "algorithm" , "digits" , "counter" , "pin" , "change-secret" ] ) ,
148
149
)
149
150
. arg (
150
151
Arg :: new ( "algorithm" )
151
152
. short ( 'a' )
152
153
. long ( "algorithm" )
153
154
. help ( "OTP Code algorithm" )
154
155
. num_args ( 1 )
155
- . required_unless_present_any ( [ "label" , "issuer" , "digits" , "counter" ] )
156
+ . required_unless_present_any ( [ "label" , "issuer" , "digits" , "counter" , "pin" , "change-secret" ] )
156
157
. value_parser ( [ "SHA1" , "SHA256" , "SHA512" ] ) ,
157
158
)
158
159
. arg (
@@ -162,7 +163,7 @@ pub fn get_matches() -> ArgMatches {
162
163
. help ( "OTP Code digits" )
163
164
. num_args ( 1 )
164
165
. value_parser ( value_parser ! ( u64 ) )
165
- . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "counter" ] ) ,
166
+ . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "counter" , "pin" , "change-secret" ] ) ,
166
167
)
167
168
. arg (
168
169
Arg :: new ( "period" )
@@ -171,7 +172,7 @@ pub fn get_matches() -> ArgMatches {
171
172
. help ( "OTP Code period" )
172
173
. num_args ( 1 )
173
174
. value_parser ( value_parser ! ( u64 ) )
174
- . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "counter" ] ) ,
175
+ . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "counter" , "pin" , "change-secret" ] ) ,
175
176
)
176
177
. arg (
177
178
Arg :: new ( "counter" )
@@ -180,14 +181,23 @@ pub fn get_matches() -> ArgMatches {
180
181
. help ( "HOTP code counter (only for HOTP codes)" )
181
182
. num_args ( 1 )
182
183
. value_parser ( value_parser ! ( u64 ) )
183
- . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "digits" ] ) ,
184
+ . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "digits" , "pin" , "change-secret" ] ) ,
185
+ )
186
+ . arg (
187
+ Arg :: new ( "pin" )
188
+ . short ( 'p' )
189
+ . long ( "pin" )
190
+ . help ( "Code pin (for Yandex and MOTP)" )
191
+ . num_args ( 1 )
192
+ . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "digits" , "counter" , "change-secret" ] ) ,
184
193
)
185
194
. arg (
186
195
Arg :: new ( "change-secret" )
187
196
. short ( 'k' )
188
197
. long ( "change-secret" )
189
198
. help ( "Change the OTP code secret" )
190
- . action ( ArgAction :: SetTrue ) ,
199
+ . action ( ArgAction :: SetTrue )
200
+ . required_unless_present_any ( [ "label" , "algorithm" , "issuer" , "digits" , "counter" , "pin" ] ) ,
191
201
) ,
192
202
)
193
203
. subcommand (
0 commit comments