Skip to content

Commit 6a4387f

Browse files
committed
Updated README.
1 parent 4b52a90 commit 6a4387f

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

README.md

+24-24
Original file line numberDiff line numberDiff line change
@@ -53,36 +53,36 @@ The project is and well suited to be included in your application. If you don't
5353
Create a class to receive parsed values:
5454

5555
```csharp
56-
class Options {
57-
[Option('r', "read", Required = true,
58-
HelpText = "Input file to be processed.")]
59-
public string InputFile { get; set; }
56+
class Options {
57+
[Option('r', "read", Required = true,
58+
HelpText = "Input file to be processed.")]
59+
public string InputFile { get; set; }
6060

61-
[Option('v', "verbose", DefaultValue = true,
62-
HelpText = "Prints all messages to standard output.")]
63-
public bool Verbose { get; set; }
64-
65-
[ParserState]
66-
public IParserState LastParserState { get; set; }
67-
68-
[HelpOption]
69-
public string GetUsage() {
70-
return HelpText.AutoBuild(this,
71-
(HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
72-
}
73-
}
61+
[Option('v', "verbose", DefaultValue = true,
62+
HelpText = "Prints all messages to standard output.")]
63+
public bool Verbose { get; set; }
64+
65+
[ParserState]
66+
public IParserState LastParserState { get; set; }
67+
68+
[HelpOption]
69+
public string GetUsage() {
70+
return HelpText.AutoBuild(this,
71+
(HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
72+
}
73+
}
7474
```
7575

7676
Add few lines to your Main method:
7777

7878
```csharp
79-
static void Main(string[] args) {
80-
var options = new Options();
81-
if (CommandLine.Parser.Default.ParseArguments(args, options)) {
82-
// Consume values here
83-
if (options.Verbose) Console.WriteLine("Filename: {0}", options.InputFile);
84-
}
85-
}
79+
static void Main(string[] args) {
80+
var options = new Options();
81+
if (CommandLine.Parser.Default.ParseArguments(args, options)) {
82+
// Consume values here
83+
if (options.Verbose) Console.WriteLine("Filename: {0}", options.InputFile);
84+
}
85+
}
8686
```
8787

8888
Acknowledgements:

0 commit comments

Comments
 (0)