Module MainPrompt
Public Const PromptSymbol As String = "TLA > "
Public Const ApplicationTitle As String = "Short name of the application"
Sub Main()
Dim Statement As String
Dim BrokenDownStatement As String()
Dim Command As String
Dim Args As String()
Dim Result As String
Console.ForegroundColor = ConsoleColor.Cyan
Console.Title = ApplicationTitle & " command line console"
Console.WriteLine("Welcome to " & ApplicationTitle & "console frontend")
Console.WriteLine("This package is version " & GetType(Project.BaseClass).Assembly.GetName().Version.ToString)
Console.WriteLine()
Console.Write(PromptSymbol)
Do While True
Statement = Console.ReadLine()
BrokenDownStatement = Statement.Split(" ")
ReDim Args(BrokenDownStatement.Length - 1)
Command = BrokenDownStatement(0)
For i = 1 To BrokenDownStatement.Length - 1
Args(i - 1) = BrokenDownStatement(i)
Next
Select Case Command.ToLower
Case "example"
Result = DoSomething(Example)
Case "exit", "quit"
Exit Do
Case "ver"
Result = "This package is version " & GetType(Project.BaseClass).Assembly.GetName().Version.ToString
Case Else
Result = "Command not acknowldged: -" & Command & "-"
End Select
Console.WriteLine(" " & Result)
Console.Write(PromptSymbol)
Loop
Console.WriteLine("I am exiting, time is " & DateTime.Now.ToString("u"))
Console.WriteLine("Goodbye")
Environment.Exit(0)
End Sub
End Module