Skip to content

Commit

Permalink
SetSwitches, ProcessArgs: Removed the "-config" from all config switc…
Browse files Browse the repository at this point in the history
…hes. Added

the missing list-keys switch.
  • Loading branch information
bmatzelle committed Oct 3, 2004
1 parent 2d1a3f5 commit aef14e9
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Nini/Examples/NiniEdit/Source/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ public void ProcessArgs ()
ThrowError ("Config file does not exist");
}

if (IsArg ("list-configs")) {
if (IsArg ("list")) {
ListConfigs ();
}
if (IsArg ("list-keys")) {
ListKeys ();
}
if (IsArg ("add-config")) {
if (IsArg ("add")) {
AddConfig ();
}
if (IsArg ("remove-config")) {
if (IsArg ("remove")) {
RemoveConfig ();
}
if (IsArg ("list-keys")) {
ListKeys ();
}
if (IsArg ("set-key")) {
SetKey ();
}
Expand Down Expand Up @@ -192,7 +192,7 @@ private void ListConfigs ()
/// </summary>
private void RemoveConfig ()
{
string configName = GetArg ("remove-config");
string configName = GetArg ("remove");
if (configName == null) {
ThrowError ("You must supply a config switch");
}
Expand All @@ -210,7 +210,7 @@ private void RemoveConfig ()
private void AddConfig ()
{
IConfigSource source = LoadSource (configPath);
source.AddConfig (GetArg ("add-config"));
source.AddConfig (GetArg ("add"));

source.Save ();
}
Expand Down Expand Up @@ -309,9 +309,9 @@ private void SetSwitches ()
argvSource.AddSwitch (configName, "version", "v");

// Config switches
argvSource.AddSwitch (configName, "list-configs", "l");
argvSource.AddSwitch (configName, "remove-config", "r");
argvSource.AddSwitch (configName, "add-config", "a");
argvSource.AddSwitch (configName, "list", "l");
argvSource.AddSwitch (configName, "remove", "r");
argvSource.AddSwitch (configName, "add", "a");
argvSource.AddSwitch (configName, "set-type", "s");

// Key switches
Expand Down

0 comments on commit aef14e9

Please sign in to comment.