14
14
15
15
#![ deny( warnings) ]
16
16
17
+ use clap:: Parser ;
17
18
use git2:: { Blob , Diff , DiffOptions , Error , Object , ObjectType , Oid , Repository } ;
18
19
use git2:: { DiffDelta , DiffFindOptions , DiffFormat , DiffHunk , DiffLine } ;
19
20
use std:: str;
20
- use structopt:: StructOpt ;
21
21
22
- #[ derive( StructOpt ) ]
22
+ #[ derive( Parser ) ]
23
23
#[ allow( non_snake_case) ]
24
24
struct Args {
25
25
#[ structopt( name = "from_oid" ) ]
@@ -56,19 +56,19 @@ struct Args {
56
56
#[ structopt( name = "no-color" , long) ]
57
57
/// never use color output
58
58
flag_no_color : bool ,
59
- #[ structopt( short = "R" ) ]
59
+ #[ structopt( short = 'R' ) ]
60
60
/// swap two inputs
61
61
flag_R : bool ,
62
- #[ structopt( name = "text" , short = "a" , long) ]
62
+ #[ structopt( name = "text" , short = 'a' , long) ]
63
63
/// treat all files as text
64
64
flag_text : bool ,
65
65
#[ structopt( name = "ignore-space-at-eol" , long) ]
66
66
/// ignore changes in whitespace at EOL
67
67
flag_ignore_space_at_eol : bool ,
68
- #[ structopt( name = "ignore-space-change" , short = "b" , long) ]
68
+ #[ structopt( name = "ignore-space-change" , short = 'b' , long) ]
69
69
/// ignore changes in amount of whitespace
70
70
flag_ignore_space_change : bool ,
71
- #[ structopt( name = "ignore-all-space" , short = "w" , long) ]
71
+ #[ structopt( name = "ignore-all-space" , short = 'w' , long) ]
72
72
/// ignore whitespace when comparing lines
73
73
flag_ignore_all_space : bool ,
74
74
#[ structopt( name = "ignored" , long) ]
@@ -95,19 +95,19 @@ struct Args {
95
95
#[ structopt( name = "summary" , long) ]
96
96
/// output condensed summary of header info
97
97
flag_summary : bool ,
98
- #[ structopt( name = "find-renames" , short = "M" , long) ]
98
+ #[ structopt( name = "find-renames" , short = 'M' , long) ]
99
99
/// set threshold for finding renames (default 50)
100
100
flag_find_renames : Option < u16 > ,
101
- #[ structopt( name = "find-copies" , short = "C" , long) ]
101
+ #[ structopt( name = "find-copies" , short = 'C' , long) ]
102
102
/// set threshold for finding copies (default 50)
103
103
flag_find_copies : Option < u16 > ,
104
104
#[ structopt( name = "find-copies-harder" , long) ]
105
105
/// inspect unmodified files for sources of copies
106
106
flag_find_copies_harder : bool ,
107
- #[ structopt( name = "break_rewrites" , short = "B" , long) ]
107
+ #[ structopt( name = "break_rewrites" , short = 'B' , long) ]
108
108
/// break complete rewrite changes into pairs
109
109
flag_break_rewrites : bool ,
110
- #[ structopt( name = "unified" , short = "U" , long) ]
110
+ #[ structopt( name = "unified" , short = 'U' , long) ]
111
111
/// lints of context to show
112
112
flag_unified : Option < u32 > ,
113
113
#[ structopt( name = "inter-hunk-context" , long) ]
@@ -360,7 +360,7 @@ impl Args {
360
360
}
361
361
362
362
fn main ( ) {
363
- let args = Args :: from_args ( ) ;
363
+ let args = Args :: parse ( ) ;
364
364
match run ( & args) {
365
365
Ok ( ( ) ) => { }
366
366
Err ( e) => println ! ( "error: {}" , e) ,
0 commit comments