refactor: add brackets to some abbreviated if statements

This commit is contained in:
Carson McManus 2017-05-22 17:56:54 -04:00
parent 5018803889
commit 0a21502a8f

View file

@ -42,7 +42,9 @@ namespace SteamGuard
{ {
i++; i++;
if (i < args.Length) if (i < args.Length)
{
SteamGuardPath = args[i]; SteamGuardPath = args[i];
}
else else
{ {
Console.WriteLine($"Expected path after {args[i-1]}"); Console.WriteLine($"Expected path after {args[i-1]}");
@ -84,15 +86,21 @@ namespace SteamGuard
action = "generate-code"; action = "generate-code";
} }
else if (string.IsNullOrEmpty(user)) else if (string.IsNullOrEmpty(user))
{
user = args[i]; user = args[i];
} }
}
else if (string.IsNullOrEmpty(user)) else if (string.IsNullOrEmpty(user))
{
user = args[i]; user = args[i];
} }
} }
}
if (string.IsNullOrEmpty(action)) if (string.IsNullOrEmpty(action))
{
action = "generate-code"; action = "generate-code";
}
// Do some configuring // Do some configuring
SteamGuardPath = SteamGuardPath.Replace("~", Environment.GetEnvironmentVariable("HOME")); SteamGuardPath = SteamGuardPath.Replace("~", Environment.GetEnvironmentVariable("HOME"));
@ -110,9 +118,12 @@ namespace SteamGuard
} }
} }
if (Verbose) Console.WriteLine($"Action: {action}"); if (Verbose)
if (Verbose) Console.WriteLine($"User: {user}"); {
if (Verbose) Console.WriteLine($"maFiles path: {SteamGuardPath}"); Console.WriteLine($"Action: {action}");
Console.WriteLine($"User: {user}");
Console.WriteLine($"maFiles path: {SteamGuardPath}");
}
// Perform desired action // Perform desired action
switch (action) switch (action)