1
1
mirror of https://github.com/mcuadros/ascode synced 2024-11-23 01:11:59 +01:00
ascode/main.go

29 lines
721 B
Go
Raw Normal View History

package main
import (
"fmt"
"os"
"github.com/ascode-dev/ascode/cmd"
"github.com/jessevdk/go-flags"
)
var version string
var build string
func main() {
parser := flags.NewNamedParser("ascode", flags.Default)
parser.LongDescription = "AsCode - The real infrastructure as code."
parser.AddCommand("run", cmd.RunCmdShortDescription, cmd.RunCmdLongDescription, &cmd.RunCmd{})
parser.AddCommand("repl", cmd.REPLCmdShortDescription, cmd.REPLCmdLongDescription, &cmd.REPLCmd{})
if _, err := parser.Parse(); err != nil {
if flagsErr, ok := err.(*flags.Error); ok && flagsErr.Type == flags.ErrHelp {
fmt.Printf("Build information\n commit: %s\n date:%s\n", version, build)
os.Exit(0)
}
os.Exit(1)
}
}