File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ public class ColorCatOptions
2323 [ ValueList ( typeof ( List < string > ) ) ]
2424 public IList < string > Pattern { get ; set ; }
2525
26+ [ Option ( "saveDefaultConfig" , HelpText = "Overwrites the current configuration with the defaults." ) ]
27+ public bool SaveDefaults { get ; set ; }
28+
2629 [ HelpOption ]
2730 public string GetUsage ( )
2831 {
Original file line number Diff line number Diff line change 11using System ;
2- using System . Collections . Generic ;
32using System . Linq ;
43
54namespace ColorCat
@@ -16,6 +15,10 @@ public static void Main(string[] args)
1615 {
1716 AddConfig ( options ) ;
1817 }
18+ else if ( options . SaveDefaults )
19+ {
20+ SaveDefaults ( ) ;
21+ }
1922 else
2023 {
2124 Run ( options ) ;
@@ -85,5 +88,12 @@ private static ColorMapping CreateMapping(ColorCatOptions options)
8588
8689 return mapping ;
8790 }
91+
92+ private static void SaveDefaults ( )
93+ {
94+ var mappingJson = Configuration . SaveDefaults ( ) ;
95+ Console . WriteLine ( "Default mappings saved. Current mappings are:" ) ;
96+ Console . WriteLine ( mappingJson ) ;
97+ }
8898 }
8999}
You can’t perform that action at this time.
0 commit comments