1
1
use crate :: api:: auth:: session;
2
- use crate :: args:: { sub_cmd , Args , SubCmds } ;
2
+ use crate :: args:: { cmd , Args , Cmd } ;
3
3
use crate :: infra:: option:: { IntoOption , OptionExt } ;
4
4
use anyhow:: Result ;
5
5
@@ -35,7 +35,7 @@ pub fn user_info(args: &Args) -> Option<Result<String>> {
35
35
match args {
36
36
Args {
37
37
command :
38
- Some ( SubCmds :: User ( sub_cmd :: User {
38
+ Some ( Cmd :: User ( cmd :: user :: Opt {
39
39
login : None ,
40
40
logout : false ,
41
41
info : true ,
@@ -57,7 +57,7 @@ pub fn publish_ing(args: &Args) -> Option<Result<(String, &String)>> {
57
57
match args {
58
58
Args {
59
59
command :
60
- Some ( SubCmds :: Ing ( sub_cmd :: Ing {
60
+ Some ( Cmd :: Ing ( cmd :: ing :: Opt {
61
61
list : false ,
62
62
publish : Some ( content) ,
63
63
comment : None ,
@@ -79,7 +79,7 @@ pub fn login(args: &Args) -> Option<&String> {
79
79
match args {
80
80
Args {
81
81
command :
82
- Some ( SubCmds :: User ( sub_cmd :: User {
82
+ Some ( Cmd :: User ( cmd :: user :: Opt {
83
83
login : Some ( pat) ,
84
84
logout : false ,
85
85
info : false ,
@@ -101,7 +101,7 @@ pub fn logout(args: &Args) -> bool {
101
101
matches ! (
102
102
args,
103
103
Args {
104
- command: Some ( SubCmds :: User ( sub_cmd :: User {
104
+ command: Some ( Cmd :: User ( cmd :: user :: Opt {
105
105
login: None ,
106
106
logout: true ,
107
107
info: false ,
@@ -121,7 +121,7 @@ pub fn list_ing(args: &Args) -> Option<Result<(String, usize, usize)>> {
121
121
match args {
122
122
Args {
123
123
command :
124
- Some ( SubCmds :: Ing ( sub_cmd :: Ing {
124
+ Some ( Cmd :: Ing ( cmd :: ing :: Opt {
125
125
list : true ,
126
126
publish : None ,
127
127
comment : None ,
@@ -147,7 +147,7 @@ pub fn comment_ing(args: &Args) -> Option<Result<(String, &String, usize)>> {
147
147
match args {
148
148
Args {
149
149
command :
150
- Some ( SubCmds :: Ing ( sub_cmd :: Ing {
150
+ Some ( Cmd :: Ing ( cmd :: ing :: Opt {
151
151
list : false ,
152
152
publish : None ,
153
153
comment : Some ( content) ,
@@ -169,7 +169,7 @@ pub fn show_post(args: &Args) -> Option<Result<(String, usize)>> {
169
169
match args {
170
170
Args {
171
171
command :
172
- Some ( SubCmds :: Post ( sub_cmd :: Post {
172
+ Some ( Cmd :: Post ( cmd :: post :: Opt {
173
173
show : true ,
174
174
show_meta : false ,
175
175
list : false ,
@@ -193,7 +193,7 @@ pub fn show_post_meta(args: &Args) -> Option<Result<(String, usize)>> {
193
193
match args {
194
194
Args {
195
195
command :
196
- Some ( SubCmds :: Post ( sub_cmd :: Post {
196
+ Some ( Cmd :: Post ( cmd :: post :: Opt {
197
197
show : false ,
198
198
show_meta : true ,
199
199
list : false ,
@@ -217,7 +217,7 @@ pub fn list_post(args: &Args) -> Option<Result<(String, usize, usize)>> {
217
217
match args {
218
218
Args {
219
219
command :
220
- Some ( SubCmds :: Post ( sub_cmd :: Post {
220
+ Some ( Cmd :: Post ( cmd :: post :: Opt {
221
221
show : false ,
222
222
show_meta : false ,
223
223
list : true ,
@@ -245,7 +245,7 @@ pub fn delete_post(args: &Args) -> Option<Result<(String, usize)>> {
245
245
match args {
246
246
Args {
247
247
command :
248
- Some ( SubCmds :: Post ( sub_cmd :: Post {
248
+ Some ( Cmd :: Post ( cmd :: post :: Opt {
249
249
show : false ,
250
250
show_meta : false ,
251
251
list : false ,
@@ -269,7 +269,7 @@ pub fn search_post(args: &Args) -> Option<Result<(String, &String, usize, usize)
269
269
match args {
270
270
Args {
271
271
command :
272
- Some ( SubCmds :: Post ( sub_cmd :: Post {
272
+ Some ( Cmd :: Post ( cmd :: post :: Opt {
273
273
show : false ,
274
274
show_meta : false ,
275
275
list : false ,
0 commit comments