File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -302,14 +302,15 @@ impl Info {
302
302
image_backend : Option < Box < dyn ImageBackend > > ,
303
303
no_merges : bool ,
304
304
color_blocks_flag : bool ,
305
+ author_nb : usize ,
305
306
) -> Result < Info > {
306
307
let repo = Repository :: discover ( & dir) . map_err ( |_| Error :: NotGitRepo ) ?;
307
308
let workdir = repo. workdir ( ) . ok_or ( Error :: BareGitRepo ) ?;
308
309
let workdir_str = workdir. to_str ( ) . unwrap ( ) ;
309
310
310
311
let config = Info :: get_configuration ( & repo) ?;
311
312
let current_commit_info = Info :: get_current_commit_info ( & repo) ?;
312
- let authors = Info :: get_authors ( workdir_str, no_merges, 3 ) ;
313
+ let authors = Info :: get_authors ( workdir_str, no_merges, author_nb ) ;
313
314
let ( git_v, git_user) = Info :: get_git_info ( workdir_str) ;
314
315
let version = Info :: get_version ( workdir_str) ?;
315
316
let commits = Info :: get_commits ( workdir_str, no_merges) ?;
Original file line number Diff line number Diff line change @@ -221,6 +221,13 @@ Possible values: [{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}]",
221
221
. long ( "no-color-blocks" )
222
222
. help ( "Hide the color blocks" ) ,
223
223
)
224
+ . arg (
225
+ Arg :: with_name ( "authors-number" )
226
+ . short ( "A" )
227
+ . long ( "authors-number" )
228
+ . takes_value ( true )
229
+ . help ( "Defines the number of authors to be shown" ) ,
230
+ )
224
231
. get_matches ( ) ;
225
232
226
233
if matches. is_present ( "languages" ) {
@@ -233,6 +240,7 @@ Possible values: [{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}]",
233
240
}
234
241
235
242
let dir = String :: from ( matches. value_of ( "directory" ) . unwrap ( ) ) ;
243
+
236
244
let custom_logo: Language = if let Some ( ascii_language) = matches. value_of ( "ascii-language" ) {
237
245
Language :: from_str ( & ascii_language. to_lowercase ( ) ) . unwrap ( )
238
246
} else {
@@ -304,6 +312,12 @@ Possible values: [{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}]",
304
312
305
313
let color_blocks_flag = matches. is_present ( "no-color-blocks" ) ;
306
314
315
+ let author_number: usize = if let Some ( value) = matches. value_of ( "authors-number" ) {
316
+ usize:: from_str ( value) . unwrap ( )
317
+ } else {
318
+ 3
319
+ } ;
320
+
307
321
let info = Info :: new (
308
322
& dir,
309
323
custom_logo,
@@ -314,6 +328,7 @@ Possible values: [{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}{12}{13}{14}{15}]",
314
328
image_backend,
315
329
no_merges,
316
330
color_blocks_flag,
331
+ author_number,
317
332
) ?;
318
333
319
334
print ! ( "{}" , info) ;
You can’t perform that action at this time.
0 commit comments