@@ -3,14 +3,19 @@ pub mod commands;
33pub mod styles;
44pub mod utils;
55
6+ <<<<<<< HEAD
67use crate :: cli:: { Arg , Cli , CmdOption , Command } ;
8+ =======
9+ use crate :: cli:: { Arg , Cli , Command } ;
10+ >>>>>>> refs/remotes/origin/main
711use crate :: commands:: relations:: { relations_command , RelationType } ;
812use crate :: commands:: releases:: releases_command ;
913use crate :: commands:: repo:: repo_command ;
1014use crate :: commands:: user:: user_command ;
1115use crate :: utils:: { install , validate_and_convert_path , OS } ;
1216
1317fn main ( ) {
18+ <<<<<<< HEAD
1419 let cli = Cli :: new ( )
1520 . with_command( Command :: new( "help" , "Prints help information" ) . with_option(
1621 CmdOption :: new( "command" , "COMMAND" , "The command you want help with" ) . optional( ) ,
@@ -173,6 +178,186 @@ fn main() {
173178 'd' ,
174179 ) ) ,
175180 ) ;
181+ =======
182+ let cli = Cli :: new( ) . with_default_command( "help" ) . with_commands( vec ! [
183+ Command :: new( "version" , "Displays the current version of github-stats" ) . with_short( 'v' ) ,
184+ Command :: new( "install" , "Installs the files and directories" ) ,
185+ Command :: new( "repo" , "Gives all stats found on a repository as json" )
186+ . with_arg(
187+ Arg :: new( )
188+ . with_name( "user" )
189+ . with_short( 'u' )
190+ . with_long( "user" )
191+ . with_value_name( "USER" )
192+ . with_help( "The user who owns the repository" ) ,
193+ )
194+ . with_arg(
195+ Arg :: new( )
196+ . with_name( "repository" )
197+ . with_short( 'r' )
198+ . with_long( "repository" )
199+ . with_value_name( "REPOSITORY" )
200+ . with_help( "Name of the repository" ) ,
201+ )
202+ . with_arg(
203+ Arg :: new( )
204+ . with_name( "output" )
205+ . with_short( 'o' )
206+ . with_long( "output" )
207+ . with_value_name( "OUTPUT" )
208+ . with_help( "File path to save the json" ) ,
209+ )
210+ . with_arg(
211+ Arg :: new( )
212+ . with_name( "display" )
213+ . with_short( 'd' )
214+ . with_long( "display" )
215+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
216+ ) ,
217+ Command :: new( "releases" , "Gives information on github releases" )
218+ . with_arg(
219+ Arg :: new( )
220+ . with_name( "user" )
221+ . with_short( 'u' )
222+ . with_long( "user" )
223+ . with_value_name( "USER" )
224+ . with_help( "The user who owns the repository" ) ,
225+ )
226+ . with_arg(
227+ Arg :: new( )
228+ . with_name( "repository" )
229+ . with_short( 'r' )
230+ . with_long( "repository" )
231+ . with_value_name( "REPOSITORY" )
232+ . with_help( "Name of the repository" ) ,
233+ )
234+ . with_arg(
235+ Arg :: new( )
236+ . with_name( "individual" )
237+ . with_short( 'i' )
238+ . with_long( "individual" )
239+ . with_help( "Downloads per release" ) ,
240+ )
241+ . with_arg(
242+ Arg :: new( )
243+ . with_name( "link" )
244+ . with_short( 'l' )
245+ . with_long( "link" )
246+ . with_help( "Download links for releases (if not individual then for latest)" ) ,
247+ )
248+ . with_arg(
249+ Arg :: new( )
250+ . with_name( "output" )
251+ . with_short( 'o' )
252+ . with_long( "output" )
253+ . with_value_name( "OUTPUT" )
254+ . with_help( "File path to save the json" ) ,
255+ )
256+ . with_arg(
257+ Arg :: new( )
258+ . with_name( "all" )
259+ . with_short( 'a' )
260+ . with_long( "all" )
261+ . with_help( "All json from request" ) ,
262+ )
263+ . with_arg(
264+ Arg :: new( )
265+ . with_name( "display" )
266+ . with_short( 'd' )
267+ . with_long( "display" )
268+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
269+ ) ,
270+ Command :: new( "user" , "Gives information about a github user" )
271+ . with_arg(
272+ Arg :: new( )
273+ . with_name( "user" )
274+ . with_short( 'u' )
275+ . with_long( "user" )
276+ . with_value_name( "USER" )
277+ . with_help( "The user you want information on" ) ,
278+ )
279+ . with_arg(
280+ Arg :: new( )
281+ . with_name( "output" )
282+ . with_short( 'o' )
283+ . with_long( "output" )
284+ . with_value_name( "OUTPUT" )
285+ . with_help( "File path to save the json" ) ,
286+ )
287+ . with_arg(
288+ Arg :: new( )
289+ . with_name( "display" )
290+ . with_short( 'd' )
291+ . with_long( "display" )
292+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
293+ ) ,
294+ Command :: new( "followers" , "Lists the followers of a github user" )
295+ . with_arg(
296+ Arg :: new( )
297+ . with_name( "user" )
298+ . with_short( 'u' )
299+ . with_long( "user" )
300+ . with_value_name( "USER" )
301+ . with_help( "The user you want information on" ) ,
302+ )
303+ . with_arg(
304+ Arg :: new( )
305+ . with_name( "total" )
306+ . with_short( 't' )
307+ . with_long( "total" )
308+ . with_value_name( "TOTAL" )
309+ . with_help( "Gives the follower count" ) ,
310+ )
311+ . with_arg(
312+ Arg :: new( )
313+ . with_name( "output" )
314+ . with_short( 'o' )
315+ . with_long( "output" )
316+ . with_value_name( "OUTPUT" )
317+ . with_help( "File path to save the json" ) ,
318+ )
319+ . with_arg(
320+ Arg :: new( )
321+ . with_name( "display" )
322+ . with_short( 'd' )
323+ . with_long( "display" )
324+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
325+ ) ,
326+ Command :: new( "following" , "Lists users the user is following" )
327+ . with_arg(
328+ Arg :: new( )
329+ . with_name( "user" )
330+ . with_short( 'u' )
331+ . with_long( "user" )
332+ . with_value_name( "USER" )
333+ . with_help( "The user you want information on" ) ,
334+ )
335+ . with_arg(
336+ Arg :: new( )
337+ . with_name( "total" )
338+ . with_short( 't' )
339+ . with_long( "total" )
340+ . with_value_name( "TOTAL" )
341+ . with_help( "Gives the following count" ) ,
342+ )
343+ . with_arg(
344+ Arg :: new( )
345+ . with_name( "output" )
346+ . with_short( 'o' )
347+ . with_long( "output" )
348+ . with_value_name( "OUTPUT" )
349+ . with_help( "File path to save the json" ) ,
350+ )
351+ . with_arg(
352+ Arg :: new( )
353+ . with_name( "display" )
354+ . with_short( 'd' )
355+ . with_long( "display" )
356+ . with_help( "Converts the json to an easier format (will remove some data)" ) ,
357+ ) ,
358+ Command :: new( "help" , "Helps you with the commands" ) . with_short( 'h' ) ,
359+ ] ) ;
360+ >>>>>>> refs/remotes/origin/main
176361
177362 let command = cli. match_commands( ) ;
178363
@@ -188,9 +373,15 @@ fn main() {
188373 install( & os) ;
189374 }
190375 "repo" => {
376+ <<<<<<< HEAD
191377 let user = command. get_option( "user" ) . throw_if_none( ) ;
192378 let repo = command. get_option( "repository" ) . throw_if_none( ) ;
193379 let output = command. get_arg( "output" ) . to_option( ) ;
380+ =======
381+ let user = command. get_value_of( "user" ) . throw_if_none( ) ;
382+ let repo = command. get_value_of( "repository" ) . throw_if_none( ) ;
383+ let output = command. get_value_of( "output" ) . to_option( ) ;
384+ >>>>>>> refs/remotes/origin/main
194385 let display = command. has( "display" ) ;
195386
196387 let output = output_to_path( output) ;
0 commit comments