Improved project structure
This commit is contained in:
parent
3a002a7562
commit
bd73132a30
18 changed files with 33 additions and 15 deletions
21
src/cli/Main.go
Normal file
21
src/cli/Main.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package cli
|
||||
|
||||
// Main is the entry point for the CLI frontend.
|
||||
// It returns the exit code of the compiler.
|
||||
// We never call os.Exit directly here because it's bad for testing.
|
||||
func Main(args []string) int {
|
||||
if len(args) == 0 {
|
||||
return Help(nil)
|
||||
}
|
||||
|
||||
switch args[0] {
|
||||
case "build":
|
||||
return Build(args[1:])
|
||||
|
||||
case "system":
|
||||
return System(args[1:])
|
||||
|
||||
default:
|
||||
return Help(args[1:])
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue