From 0a21502a8f1a719f30ae40d80488398631b55aeb Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Mon, 22 May 2017 17:56:54 -0400 Subject: [PATCH] refactor: add brackets to some abbreviated if statements --- Program.cs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index 9de521d..93dbb30 100644 --- a/Program.cs +++ b/Program.cs @@ -42,7 +42,9 @@ namespace SteamGuard { i++; if (i < args.Length) + { SteamGuardPath = args[i]; + } else { Console.WriteLine($"Expected path after {args[i-1]}"); @@ -84,15 +86,21 @@ namespace SteamGuard action = "generate-code"; } else if (string.IsNullOrEmpty(user)) + { user = args[i]; + } } else if (string.IsNullOrEmpty(user)) + { user = args[i]; + } } } if (string.IsNullOrEmpty(action)) + { action = "generate-code"; + } // Do some configuring SteamGuardPath = SteamGuardPath.Replace("~", Environment.GetEnvironmentVariable("HOME")); @@ -110,9 +118,12 @@ namespace SteamGuard } } - if (Verbose) Console.WriteLine($"Action: {action}"); - if (Verbose) Console.WriteLine($"User: {user}"); - if (Verbose) Console.WriteLine($"maFiles path: {SteamGuardPath}"); + if (Verbose) + { + Console.WriteLine($"Action: {action}"); + Console.WriteLine($"User: {user}"); + Console.WriteLine($"maFiles path: {SteamGuardPath}"); + } // Perform desired action switch (action)