Skip to content

Commit

Permalink
Add parameter parsing error messages. Increase console column width.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed Apr 14, 2021
1 parent 2b0be8d commit 5094f4a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Server.Installer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ private static bool ParseCliParams(string[] args, out CliParams cliParams)
cliParams.ServerUrl = result;
continue;
}
ConsoleHelper.WriteError("--server-url parameter is invalid. Must be a valid URL (e.g. https://app.remotely.one).");
return false;
}
case "--install-directory":
Expand All @@ -202,6 +203,7 @@ private static bool ParseCliParams(string[] args, out CliParams cliParams)
cliParams.CreateNew = result;
continue;
}
ConsoleHelper.WriteError("--create-new parameter is invalid. Must be true or false.");
return false;
}
case "--web-server":
Expand All @@ -212,6 +214,8 @@ private static bool ParseCliParams(string[] args, out CliParams cliParams)
cliParams.WebServer = (WebServerType)webServerResult;
continue;
}
ConsoleHelper.WriteError($"--web-server parameter is invalid. Must be a " +
$"number (0 - {Enum.GetValues<WebServerType>().Length}).");
return false;
}
default:
Expand Down
2 changes: 1 addition & 1 deletion Shared/Utilities/ConsoleHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void WriteLine(string message, int extraEmptyLines = 0, ConsoleCol

var line = new string(message.Skip(i).TakeWhile(x => {
i++;
return lineCount++ < 50 || !char.IsWhiteSpace(x);
return lineCount++ < 60 || !char.IsWhiteSpace(x);
}).ToArray());

if (trimLine)
Expand Down

0 comments on commit 5094f4a

Please sign in to comment.