1414
1515#![ deny( warnings) ]
1616
17+ use clap:: Parser ;
1718use git2:: { Blob , Diff , DiffOptions , Error , Object , ObjectType , Oid , Repository } ;
1819use git2:: { DiffDelta , DiffFindOptions , DiffFormat , DiffHunk , DiffLine } ;
1920use std:: str;
20- use structopt:: StructOpt ;
2121
22- #[ derive( StructOpt ) ]
22+ #[ derive( Parser ) ]
2323#[ allow( non_snake_case) ]
2424struct Args {
2525 #[ structopt( name = "from_oid" ) ]
@@ -56,19 +56,19 @@ struct Args {
5656 #[ structopt( name = "no-color" , long) ]
5757 /// never use color output
5858 flag_no_color : bool ,
59- #[ structopt( short = "R" ) ]
59+ #[ structopt( short = 'R' ) ]
6060 /// swap two inputs
6161 flag_R : bool ,
62- #[ structopt( name = "text" , short = "a" , long) ]
62+ #[ structopt( name = "text" , short = 'a' , long) ]
6363 /// treat all files as text
6464 flag_text : bool ,
6565 #[ structopt( name = "ignore-space-at-eol" , long) ]
6666 /// ignore changes in whitespace at EOL
6767 flag_ignore_space_at_eol : bool ,
68- #[ structopt( name = "ignore-space-change" , short = "b" , long) ]
68+ #[ structopt( name = "ignore-space-change" , short = 'b' , long) ]
6969 /// ignore changes in amount of whitespace
7070 flag_ignore_space_change : bool ,
71- #[ structopt( name = "ignore-all-space" , short = "w" , long) ]
71+ #[ structopt( name = "ignore-all-space" , short = 'w' , long) ]
7272 /// ignore whitespace when comparing lines
7373 flag_ignore_all_space : bool ,
7474 #[ structopt( name = "ignored" , long) ]
@@ -95,19 +95,19 @@ struct Args {
9595 #[ structopt( name = "summary" , long) ]
9696 /// output condensed summary of header info
9797 flag_summary : bool ,
98- #[ structopt( name = "find-renames" , short = "M" , long) ]
98+ #[ structopt( name = "find-renames" , short = 'M' , long) ]
9999 /// set threshold for finding renames (default 50)
100100 flag_find_renames : Option < u16 > ,
101- #[ structopt( name = "find-copies" , short = "C" , long) ]
101+ #[ structopt( name = "find-copies" , short = 'C' , long) ]
102102 /// set threshold for finding copies (default 50)
103103 flag_find_copies : Option < u16 > ,
104104 #[ structopt( name = "find-copies-harder" , long) ]
105105 /// inspect unmodified files for sources of copies
106106 flag_find_copies_harder : bool ,
107- #[ structopt( name = "break_rewrites" , short = "B" , long) ]
107+ #[ structopt( name = "break_rewrites" , short = 'B' , long) ]
108108 /// break complete rewrite changes into pairs
109109 flag_break_rewrites : bool ,
110- #[ structopt( name = "unified" , short = "U" , long) ]
110+ #[ structopt( name = "unified" , short = 'U' , long) ]
111111 /// lints of context to show
112112 flag_unified : Option < u32 > ,
113113 #[ structopt( name = "inter-hunk-context" , long) ]
@@ -360,7 +360,7 @@ impl Args {
360360}
361361
362362fn main ( ) {
363- let args = Args :: from_args ( ) ;
363+ let args = Args :: parse ( ) ;
364364 match run ( & args) {
365365 Ok ( ( ) ) => { }
366366 Err ( e) => println ! ( "error: {}" , e) ,
0 commit comments