Skip to content

Commit 9cb0e30

Browse files
author
Ethan Lindemann-Michael
committed
Updated VB.NET quick start example
1 parent 46bf0bc commit 9cb0e30

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,25 +102,25 @@ VB.Net:
102102

103103
```VB.NET
104104
Class Options
105-
<CommandLine.Option('r', "read", Required := true,
106-
HelpText:="Input files to be processed.")>
107-
Public Property InputFiles As IEnumerable(Of String)
108-
109-
' Omitting long name, defaults to name of property, ie "--verbose"
110-
<CommandLine.Option(
111-
HelpText:="Prints all messages to standard output.")>
112-
Public Property Verbose As Boolean
113-
114-
<CommandLine.Option(DefaultValue:="中文",
115-
HelpText:="Content language.")>
116-
Public Property Language As String
117-
118-
<CommandLine.Value(0, MetaName:="offset",
119-
HelpText:="File offset.")>
120-
Public Property Offset As Long?
105+
<CommandLine.Option("r", "read", Required:=True, HelpText:="Input files to be processed.")>
106+
Public Property InputFiles As IEnumerable(Of String)
107+
108+
' Omitting long name, defaults to name of property, ie "--verbose"
109+
<CommandLine.Option(HelpText:="Prints all messages to standard output.")>
110+
Public Property Verbose As Boolean
111+
112+
<CommandLine.Option([Default]:="中文", HelpText:="Content language.")>
113+
Public Property Language As String
114+
115+
<CommandLine.Value(0, MetaName:="offset", HelpText:="File offset.")>
116+
Public Property Offset As Long?
121117
End Class
122118

123-
'TODO
119+
Sub Main(ByVal args As String())
120+
CommandLine.Parser.Default.ParseArguments(Of Options)(args) _
121+
.WithParsed(Function(opts As Options) RunOptionsAndReturnExitCode(opts)) _
122+
.WithNotParsed(Function(errs As IEnumerable(Of [Error])) 1)
123+
End Sub
124124
```
125125

126126
### For verbs:
@@ -173,12 +173,12 @@ End Class
173173

174174
Function Main(ByVal args As String()) As Integer
175175
Return CommandLine.Parser.Default.ParseArguments(Of AddOptions, CommitOptions, CloneOptions)(args) _
176-
.MapResult(
177-
(Function(opts As AddOptions) RunAddAndReturnExitCode(opts)),
178-
(Function(opts As CommitOptions) RunCommitAndReturnExitCode(opts)),
179-
(Function(opts As CloneOptions) RunCloneAndReturnExitCode(opts)),
180-
(Function(errs As IEnumerable(Of [Error])) 1)
181-
)
176+
.MapResult(
177+
(Function(opts As AddOptions) RunAddAndReturnExitCode(opts)),
178+
(Function(opts As CommitOptions) RunCommitAndReturnExitCode(opts)),
179+
(Function(opts As CloneOptions) RunCloneAndReturnExitCode(opts)),
180+
(Function(errs As IEnumerable(Of [Error])) 1)
181+
)
182182
End Function
183183
```
184184

0 commit comments

Comments
 (0)