Skip to content

Commit 46bf0bc

Browse files
author
Ethan Lindemann-Michael
committed
Added VB.NET Verb example code.
1 parent bce330d commit 46bf0bc

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,20 +160,26 @@ VB.Net example:
160160
```VB.NET
161161
<CommandLine.Verb("add", HelpText:="Add file contents to the index.")>
162162
Public Class AddOptions
163-
'Normal options here
163+
'Normal options here
164164
End Class
165165
<CommandLine.Verb("commit", HelpText:="Record changes to the repository.")>
166-
Public Class AddOptions
167-
'Normal options here
166+
Public Class CommitOptions
167+
'Normal options here
168168
End Class
169169
<CommandLine.Verb("clone", HelpText:="Clone a repository into a new directory.")>
170-
Public Class AddOptions
171-
'Normal options here
170+
Public Class CloneOptions
171+
'Normal options here
172172
End Class
173173

174-
Public Shared Sub Main()
175-
'TODO
176-
End Sub
174+
Function Main(ByVal args As String()) As Integer
175+
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+
)
182+
End Function
177183
```
178184

179185
F# Example:

0 commit comments

Comments
 (0)