Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3f432bd

Browse files
add usage attribute to HeadOptions
1 parent 806d2d2 commit 3f432bd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

‎demo/ReadText.Demo/Options.cs‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using CommandLine;
2+
using CommandLine.Text;
3+
using System.Collections.Generic;
24

35
namespace ReadText.Demo
46
{
@@ -35,6 +37,18 @@ class HeadOptions : IOptions
3537
public bool Quiet { get; set; }
3638

3739
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+
}
3852
}
3953

4054
[Verb("tail", HelpText = "Displays last lines of a file.")]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /