Skip to content

Commit

Permalink
Minor formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
stho32 committed Jan 15, 2023
1 parent 7b39e5e commit c208c65
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
24 changes: 21 additions & 3 deletions Source/LocalNetAppChat/LocalNetAppChat.ConsoleClient/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public static async Task Main(string[] args)
"The text message to send to the server. (only when in message mode!)",
"The name of your client. If not specified, your machine name will be sent as clientName to the server",
"An Authentication password that the server requires to allow incoming requests from the client!",
"Whether to ignore SSL Erros in console",
"Whether to ignore SSL Errors in console",
"Path where you want the requested File to be saved at after downloading it",
"Prints out the commands and their corresponding descriptioon"
"Prints out the commands and their corresponding description"

};

Expand All @@ -63,7 +63,25 @@ public static async Task Main(string[] args)
$"\n\n [Usage]\n\n" +
$"\n{string.Join("\n", commandsWithDescription)}");

Console.WriteLine("\n\nExamples:\r\n\r\n – Start the client in listening mode\r\n $ LocalNetAppChat.ConsoleClient listener --server \"localhost\" --port 54214 --key 1234 --clientName \"GithubReadMe\"\r\n - Start the client in message mode\r\n $ LocalNetAppChat.ConsoleClient message --server \"localhost\" --port 51234 --key 1234 --text \"Hey there, I am client GithubReadMe\"\r\n - Start the client in chat mode\r\n LocalNetAppChat.ConsoleClient chat --server \"localhost\" --port 54214 --key 1234 --clientName \"GithubReadMe\"\r\n - Upload a file to the server\r\n $ LocalNetAppChat.ConsoleClient fileupload --server \"localhost\" --port 51234 --key 1234 --file \"./README.md\"\r\n - Download a file from the server\r\n $ LocalNetAppChat.ConsoleClient filedownload --server \"localhost\" --port 51234 --key 1234 --file \"./README.md\" --targetPath \"/home/github/Projects\"\r\n - Deletes a file from the server\r\n $ LocalNetAppChat.ConsoleClient filedelete --server \"localhost\" --port 51234 --key 1234 --file \"README.md\"\r\n - List all files existing on the server\r\n $ LocalNetAppChat.ConsoleClient listfiles --server \"localhost\" --port 51234 --key 1234");
Console.WriteLine(@"
Examples:
– Start the client in listening mode
$ LocalNetAppChat.ConsoleClient listener --server ""localhost"" --port 54214 --key 1234 --clientName ""GithubReadMe""
- Start the client in message mode
$ LocalNetAppChat.ConsoleClient message --server ""localhost"" --port 51234 --key 1234 --text ""Hey there, I am client GithubReadMe""
- Start the client in chat mode
LocalNetAppChat.ConsoleClient chat --server ""localhost"" --port 54214 --key 1234 --clientName ""GithubReadMe""
- Upload a file to the server
$ LocalNetAppChat.ConsoleClient fileupload --server ""localhost"" --port 51234 --key 1234 --file ""./README.md""
- Download a file from the server
$ LocalNetAppChat.ConsoleClient filedownload --server ""localhost"" --port 51234 --key 1234 --file ""./README.md"" --targetPath ""/home/github/Projects""
- Deletes a file from the server
$ LocalNetAppChat.ConsoleClient filedelete --server ""localhost"" --port 51234 --key 1234 --file ""README.md""
- List all files existing on the server
$ LocalNetAppChat.ConsoleClient listfiles --server ""localhost"" --port 51234 --key 1234
");

return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public ICommandLineOption[] GetCommandsList()
private Parser ParseArgs()
{
var parser = new Parser(
new ICommandLineOption[] {
new ICommandLineOption[]
{
new BoolCommandLineOption("message"),
new BoolCommandLineOption("listener"),
new BoolCommandLineOption("fileupload"),
Expand All @@ -37,9 +38,10 @@ private Parser ParseArgs()
new BoolCommandLineOption("--ignoresslerrors"),
new StringCommandLineOption("--targetPath"),
new BoolCommandLineOption("--help")
});
});
return parser;
}

public Result<ClientSideCommandLineParameters> Parse(string[] args)
{
var parser = this.ParseArgs();
Expand Down

0 comments on commit c208c65

Please sign in to comment.