Skip to content

Commit 31314df

Browse files
Options.vb - IOptions,HeadOptions,TailOptions
1 parent c709003 commit 31314df

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

demo/ReadText.Demo.VB/Options.vb

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Imports CommandLine
2+
3+
Public Interface IOptions
4+
5+
<[Option]("n"c, "lines", SetName:="bylines", [Default]:=5UI, HelpText:="CPU source file to read.")>
6+
Property Lines As UInteger?
7+
8+
<[Option]("c"c, "bytes", SetName:="bybytes", HelpText:="Bytes to be printed from the beginning or end of the file.")>
9+
Property Bytes As UInteger?
10+
11+
<[Option]("q"c, "quiet", HelpText:="Supresses summary messages.")>
12+
Property Quiet As Boolean
13+
14+
<[Value](0, MetaName:="input file", Required:=True, HelpText:="Input file to be processed.")>
15+
Property FileName As String
16+
17+
End Interface
18+
19+
<[Verb]("head", HelpText:="Displays first lines of a file.")>
20+
Public Class HeadOptions
21+
Implements IOptions
22+
Public Property Lines As UInteger? Implements IOptions.Lines
23+
24+
Public Property Bytes As UInteger? Implements IOptions.Bytes
25+
26+
Public Property Quiet As Boolean Implements IOptions.Quiet
27+
28+
Public Property FileName As String Implements IOptions.FileName
29+
30+
End Class
31+
32+
<[Verb]("tail", HelpText:="Displays last lines of a file.")>
33+
Public Class TailOptions
34+
Implements IOptions
35+
Public Property Lines As UInteger? Implements IOptions.Lines
36+
37+
Public Property Bytes As UInteger? Implements IOptions.Bytes
38+
39+
Public Property Quiet As Boolean Implements IOptions.Quiet
40+
41+
Public Property FileName As String Implements IOptions.FileName
42+
43+
End Class

demo/ReadText.Demo.VB/ReadText.Demo.VB.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
<Import Include="System.Threading.Tasks" />
8787
</ItemGroup>
8888
<ItemGroup>
89+
<Compile Include="Options.vb" />
8990
<Compile Include="Program.vb" />
9091
<Compile Include="My Project\AssemblyInfo.vb" />
9192
<Compile Include="My Project\Application.Designer.vb">

0 commit comments

Comments
 (0)