Skip to content
Permalink
Browse files

Refactoring in Program.cs and updated CONFIG.md

  • Loading branch information...
Duco
Duco committed Apr 10, 2019
1 parent d6cc634 commit 756886c4976edf362696854690d036f41fa80dc1
Showing with 26 additions and 3 deletions.
  1. +24 −0 docs/CONFIG.md
  2. +2 −3 src/HttPlaceholder/Program.cs
@@ -4,6 +4,30 @@ This page contains all command line arguments supported by HttPlaceholder. Confi

## Command line arguments

### Verbose output

If you want some more logging, append `-V` or `--verbose` as argument.

```bash
httplaceholder --verbose
```

### Get version

If you want to check the HttPlaceholder version, append `-v` or `--version` as argument.

```bash
httplaceholder --version
```

### Get help

If you want to see all possible configuration parameters, append `-h`, `-?` or `--help` as argument.

```bash
httplaceholder --help
```

### Input file (optional)

```bash
@@ -92,7 +92,7 @@ private static string GetManPage()
private static string GetVerbosePage(IDictionary<string, string> args)
{
var builder = new StringBuilder();
foreach(var pair in args)
foreach (var pair in args)
{
builder.AppendLine($"--{pair.Key}: {pair.Value}");
}
@@ -102,8 +102,7 @@ private static string GetVerbosePage(IDictionary<string, string> args)

private static void HandleArgument(Action action, string[] args, string[] argKeys, bool exit = true)
{
var arg = args.FirstOrDefault();
if (argKeys.Any(k => k == arg))
if (args.Any(arg => argKeys.Contains(arg)))
{
action();
if (exit)

0 comments on commit 756886c

Please sign in to comment.
You can’t perform that action at this time.