@@ -4,7 +4,7 @@ pub mod utils;
44
55use crate :: cli:: { Arg , Cli , Command } ;
66use crate :: commands:: all:: all_command;
7- use crate :: commands:: followers :: followers_command ;
7+ use crate :: commands:: relations :: { relations_command , RelationType } ;
88use crate :: commands:: releases:: releases_command;
99use crate :: commands:: user:: user_command;
1010use crate :: utils:: { install, validate_and_convert_path, OS } ;
@@ -137,7 +137,39 @@ fn main() {
137137 . with_short( 't' )
138138 . with_long( "total" )
139139 . with_value_name( "TOTAL" )
140- . with_help( "Only gives the follower count" ) ,
140+ . with_help( "Gives the follower count" ) ,
141+ )
142+ . with_arg(
143+ Arg :: new( )
144+ . with_name( "output" )
145+ . with_short( 'o' )
146+ . with_long( "output" )
147+ . with_value_name( "OUTPUT" )
148+ . with_help( "File path to save the json" ) ,
149+ )
150+ . with_arg(
151+ Arg :: new( )
152+ . with_name( "display" )
153+ . with_short( 'd' )
154+ . with_long( "display" )
155+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
156+ ) ,
157+ Command :: new( "following" , "Lists users the user is following" )
158+ . with_arg(
159+ Arg :: new( )
160+ . with_name( "user" )
161+ . with_short( 'u' )
162+ . with_long( "user" )
163+ . with_value_name( "USER" )
164+ . with_help( "The user you want information on" ) ,
165+ )
166+ . with_arg(
167+ Arg :: new( )
168+ . with_name( "total" )
169+ . with_short( 't' )
170+ . with_long( "total" )
171+ . with_value_name( "TOTAL" )
172+ . with_help( "Gives the following count" ) ,
141173 )
142174 . with_arg(
143175 Arg :: new( )
@@ -210,7 +242,17 @@ fn main() {
210242
211243 let output = output_to_path ( output) ;
212244
213- followers_command ( user, total, output, display) ;
245+ relations_command ( user, total, output, display, RelationType :: Follower ) ;
246+ }
247+ "following" => {
248+ let user = command. get_value_of ( "user" ) . throw_if_none ( ) ;
249+ let total = command. has ( "total" ) ;
250+ let output = command. get_value_of ( "output" ) . to_option ( ) ;
251+ let display = command. has ( "display" ) ;
252+
253+ let output = output_to_path ( output) ;
254+
255+ relations_command ( user, total, output, display, RelationType :: Following ) ;
214256 }
215257 "help" => cli. help ( ) ,
216258 _ => cli. help ( ) ,
0 commit comments