Skip to content

Commit ad8605e

Browse files
committed
Create deafault settings on first use
1 parent 0ddbf0d commit ad8605e

3 files changed

Lines changed: 1 addition & 15 deletions

File tree

ColorCat/ColorCatOptions.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ 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-
2926
[HelpOption]
3027
public string GetUsage()
3128
{

ColorCat/Configuration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public static Configuration Load()
2323
{
2424
var location = DefaultLocation;
2525

26-
if (!File.Exists(location)) return new Configuration { Mappings = new List<ColorMapping>() };
26+
if (!File.Exists(location)) SaveDefaults();
2727

2828
string configText;
2929
using (var r = new StreamReader(location))

ColorCat/Program.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ public static void Main(string[] args)
1515
{
1616
AddConfig(options);
1717
}
18-
else if (options.SaveDefaults)
19-
{
20-
SaveDefaults();
21-
}
2218
else
2319
{
2420
Run(options);
@@ -88,12 +84,5 @@ private static ColorMapping CreateMapping(ColorCatOptions options)
8884

8985
return mapping;
9086
}
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-
}
9887
}
9988
}

0 commit comments

Comments
 (0)