-
Notifications
You must be signed in to change notification settings - Fork 288
Open
Description
you might want to provide a VB.NET sample at readme.md or other appropriate documentation
Option Explicit On
Option Strict On
Imports CommandLine
Module MainApp
Sub Main(args As String())
Dim result As CommandLine.ParserResult(Of Options)
result = CommandLine.Parser.Default.ParseArguments(Of Options)(args)
Dim exitCode As Integer = result.MapResult(AddressOf Start, AddressOf ParserErrors)
System.Environment.Exit(exitCode)
End Sub
Private Function Start(options As Options) As Integer
Try
'Do some stuff here...
Return Nothing '-> exit code = 0
Catch ex As Exception
Return 2
End Try
End Function
Private Function ParserErrors(errors As IEnumerable(Of [Error])) As Integer
Console.WriteLine("Please resolve errors above, first")
Return 1
End Function
End Module
Metadata
Metadata
Assignees
Labels
No labels