@@ -13,16 +13,18 @@ var (
1313 nameOnly bool
1414 ignoreEmtpy bool
1515 ignoreFilePrefix []string
16+ matchExtension []string
1617)
1718
1819func init () {
1920 RootCmd .AddCommand (diffCmd )
2021
2122 diffCmd .Flags ().StringVar (& dir , "dir" , "." , "directory to diff repos from" )
2223
23- diffCmd .Flags ().BoolVar ( & ignoreEmtpy , "ignore-empty " , false , "ignore empty diffs" )
24- diffCmd .Flags ().StringArrayVar (& ignoreFilePrefix , "ignore-file-prefix " , []string {}, "ignore files in diffs with the given prefix " )
24+ diffCmd .Flags ().StringArrayVar ( & ignoreFilePrefix , "ignore-file-prefix " , [] string {} , "ignore files in diffs with the given prefix(es) " )
25+ diffCmd .Flags ().StringArrayVar (& matchExtension , "match-extension " , []string {}, "only include files in diffs with the given extension(s) " )
2526
27+ diffCmd .Flags ().BoolVar (& ignoreEmtpy , "ignore-empty" , false , "ignore empty diffs" )
2628 diffCmd .Flags ().BoolVar (& short , "shortstat" , false , "show only the number of changed files, insertions, and deletions" )
2729 diffCmd .Flags ().BoolVar (& nameOnly , "name-only" , false , "show only names of changed files" )
2830
@@ -59,6 +61,7 @@ func diffFunc(cmd *cobra.Command, args []string) error {
5961 cfg := & client.DiffConfig {
6062 IgnoreEmpty : ignoreEmtpy ,
6163 IgnoreFilePrefix : ignoreFilePrefix ,
64+ MatchExtension : matchExtension ,
6265 Args : args ,
6366 }
6467
0 commit comments