|
1 | 1 | using CommandLine;
|
| 2 | +using CommandLine.Text; |
| 3 | +using System.Collections.Generic; |
2 | 4 |
|
3 | 5 | namespace ReadText.Demo
|
4 | 6 | {
|
@@ -35,6 +37,18 @@ class HeadOptions : IOptions
|
35 | 37 | public bool Quiet { get; set; }
|
36 | 38 |
|
37 | 39 | public string FileName { get; set; }
|
| 40 | + |
| 41 | + [Usage(ApplicationAlias = "ReadText.Demo.exe")] |
| 42 | + public static IEnumerable<Example> Examples |
| 43 | + { |
| 44 | + get |
| 45 | + { |
| 46 | + yield return new Example("normal scenario", new HeadOptions { FileName = "file.bin"}); |
| 47 | + yield return new Example("specify bytes", new HeadOptions { FileName = "file.bin", Bytes=100 }); |
| 48 | + yield return new Example("supress summary", UnParserSettings.WithGroupSwitchesOnly(), new HeadOptions { FileName = "file.bin", Quiet = true }); |
| 49 | + yield return new Example("read more lines", new[] { UnParserSettings.WithGroupSwitchesOnly(), UnParserSettings.WithUseEqualTokenOnly() }, new HeadOptions { FileName = "file.bin", Lines = 10 }); |
| 50 | + } |
| 51 | + } |
38 | 52 | }
|
39 | 53 |
|
40 | 54 | [Verb("tail", HelpText = "Displays last lines of a file.")]
|
|
0 commit comments