@@ -56,19 +56,19 @@ pub struct InfoCliOptions {
5656 value_enum,
5757 value_name = "FIELD"
5858 ) ]
59- pub disabled_fields : Vec < InfoType > ,
59+ pub disabled_fields : Option < Vec < InfoType > > ,
6060 /// Hides the title
6161 #[ arg( long) ]
62- pub no_title : bool ,
62+ pub no_title : Option < bool > ,
6363 /// Maximum NUM of authors to be shown
64- #[ arg( long, default_value_t = 3usize , value_name = "NUM" ) ]
65- pub number_of_authors : usize ,
64+ #[ arg( long, value_name = "NUM" ) ]
65+ pub number_of_authors : Option < usize > ,
6666 /// Maximum NUM of languages to be shown
67- #[ arg( long, default_value_t = 6usize , value_name = "NUM" ) ]
68- pub number_of_languages : usize ,
67+ #[ arg( long, value_name = "NUM" ) ]
68+ pub number_of_languages : Option < usize > ,
6969 /// Maximum NUM of file churns to be shown
70- #[ arg( long, default_value_t = 3usize , value_name = "NUM" ) ]
71- pub number_of_file_churns : usize ,
70+ #[ arg( long, value_name = "NUM" ) ]
71+ pub number_of_file_churns : Option < usize > ,
7272 /// Minimum NUM of commits from HEAD used to compute the churn summary
7373 ///
7474 /// By default, the actual value is non-deterministic due to time-based computation
@@ -89,7 +89,7 @@ pub struct InfoCliOptions {
8989 pub no_bots : Option < MyRegex > ,
9090 /// Ignores merge commits
9191 #[ arg( long) ]
92- pub no_merges : bool ,
92+ pub no_merges : Option < bool > ,
9393 /// Show the email address of each author
9494 #[ arg( long, short = 'E' ) ]
9595 pub email : bool ,
@@ -101,7 +101,7 @@ pub struct InfoCliOptions {
101101 pub hide_token : bool ,
102102 /// Count hidden files and directories
103103 #[ arg( long) ]
104- pub include_hidden : bool ,
104+ pub include_hidden : Option < bool > ,
105105 /// Filters output by language type
106106 #[ arg(
107107 long,
@@ -147,7 +147,7 @@ pub struct AsciiCliOptions {
147147 ///
148148 /// If set to auto: true color will be enabled if supported by the terminal
149149 #[ arg( long, default_value = "auto" , value_name = "WHEN" , value_enum) ]
150- pub true_color : When ,
150+ pub true_color : Option < When > ,
151151}
152152
153153#[ derive( Clone , Debug , Args , PartialEq , Eq ) ]
@@ -191,13 +191,13 @@ pub struct TextFormattingCliOptions {
191191 pub text_colors : Vec < u8 > ,
192192 /// Use ISO 8601 formatted timestamps
193193 #[ arg( long, short = 'z' ) ]
194- pub iso_time : bool ,
194+ pub iso_time : Option < bool > ,
195195 /// Which thousands SEPARATOR to use
196- #[ arg( long, value_name = "SEPARATOR" , default_value = "plain" , value_enum) ]
197- pub number_separator : NumberSeparator ,
196+ #[ arg( long, value_name = "SEPARATOR" , value_enum) ]
197+ pub number_separator : Option < NumberSeparator > ,
198198 /// Turns off bold formatting
199199 #[ arg( long) ]
200- pub no_bold : bool ,
200+ pub no_bold : Option < bool > ,
201201}
202202#[ derive( Clone , Debug , Args , PartialEq , Eq , Default ) ]
203203#[ command( next_help_heading = "VISUALS" ) ]
@@ -212,7 +212,7 @@ pub struct VisualsCliOptions {
212212 ///
213213 /// Replaces language chips with Nerd Font icons
214214 #[ arg( long) ]
215- pub nerd_fonts : bool ,
215+ pub nerd_fonts : Option < bool > ,
216216}
217217
218218#[ derive( Clone , Debug , Args , PartialEq , Eq ) ]
@@ -268,9 +268,9 @@ impl Default for CliOptions {
268268impl Default for InfoCliOptions {
269269 fn default ( ) -> Self {
270270 InfoCliOptions {
271- number_of_authors : 3 ,
272- number_of_languages : 6 ,
273- number_of_file_churns : 3 ,
271+ number_of_authors : Some ( 3 ) ,
272+ number_of_languages : Some ( 6 ) ,
273+ number_of_file_churns : Some ( 3 ) ,
274274 churn_pool_size : Option :: default ( ) ,
275275 exclude : Vec :: default ( ) ,
276276 no_bots : Option :: default ( ) ,
@@ -280,7 +280,7 @@ impl Default for InfoCliOptions {
280280 hide_token : Default :: default ( ) ,
281281 include_hidden : Default :: default ( ) ,
282282 r#type : vec ! [ LanguageType :: Programming , LanguageType :: Markup ] ,
283- disabled_fields : Vec :: default ( ) ,
283+ disabled_fields : Some ( Vec :: default ( ) ) ,
284284 no_title : Default :: default ( ) ,
285285 }
286286 }
@@ -291,7 +291,7 @@ impl Default for TextFormattingCliOptions {
291291 TextFormattingCliOptions {
292292 text_colors : Default :: default ( ) ,
293293 iso_time : Default :: default ( ) ,
294- number_separator : NumberSeparator :: Plain ,
294+ number_separator : Some ( NumberSeparator :: Plain ) ,
295295 no_bold : Default :: default ( ) ,
296296 }
297297 }
@@ -303,7 +303,7 @@ impl Default for AsciiCliOptions {
303303 ascii_input : Option :: default ( ) ,
304304 ascii_colors : Vec :: default ( ) ,
305305 ascii_language : Option :: default ( ) ,
306- true_color : When :: Auto ,
306+ true_color : Some ( When :: Auto ) ,
307307 }
308308 }
309309}
@@ -418,8 +418,8 @@ mod test {
418418 input : PathBuf :: from ( "/tmp/folder" ) ,
419419 info : InfoCliOptions {
420420 number_of_authors : 4 ,
421- no_merges : true ,
422- disabled_fields : vec ! [ InfoType :: Version , InfoType :: URL ] ,
421+ no_merges : Some ( true ) ,
422+ disabled_fields : vec ! [ InfoType :: Version , InfoType :: URL ] . into ( ) ,
423423 ..Default :: default ( )
424424 } ,
425425 ascii : AsciiCliOptions {
0 commit comments