Skip to content

Commit d0a89fb

Browse files
Exposed INI generation option control to Settings
1 parent b4222ef commit d0a89fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Gemstone/Configuration/Settings.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ public ConfigurationOperation EnvironmentalVariables
157157
}
158158
}
159159

160+
/// <summary>
161+
/// Gets or sets the option for how to generate values in the INI file when saving settings.
162+
/// </summary>
163+
public INIGenerationOption INIGenerationOption { get; init; } = INIGenerationOption.UncommentedValueIfDifferent;
164+
160165
/// <summary>
161166
/// Gets or sets flag that determines if description lines, e.g., those encoded into an INI file,
162167
/// should be split into multiple lines.
@@ -423,7 +428,7 @@ private void SaveSections()
423428
continue;
424429

425430
// Handle INI file as a special case, writing entire file contents on save
426-
string contents = Configuration!.GenerateINIFileContents(splitDescriptionLines: SplitDescriptionLines);
431+
string contents = Configuration!.GenerateINIFileContents(INIGenerationOption, SplitDescriptionLines);
427432
string iniFilePath = GetINIFilePath("settings.ini", ConfiguredINIPath);
428433
using TextWriter writer = GetINIFileWriter(iniFilePath);
429434
writer.Write(contents);

0 commit comments

Comments
 (0)