-
Notifications
You must be signed in to change notification settings - Fork 35
/
main.go
52 lines (47 loc) · 1.44 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"log"
"os"
"time"
"github.com/spacelift-io/spacectl/internal/cmd/blueprint"
"github.com/spacelift-io/spacectl/internal/cmd/completion"
"github.com/spacelift-io/spacectl/internal/cmd/module"
"github.com/spacelift-io/spacectl/internal/cmd/profile"
"github.com/spacelift-io/spacectl/internal/cmd/provider"
runexternaldependency "github.com/spacelift-io/spacectl/internal/cmd/run_external_dependency"
"github.com/spacelift-io/spacectl/internal/cmd/stack"
versioncmd "github.com/spacelift-io/spacectl/internal/cmd/version"
"github.com/spacelift-io/spacectl/internal/cmd/whoami"
"github.com/spacelift-io/spacectl/internal/cmd/workerpools"
"github.com/urfave/cli/v2"
)
var version = "dev"
var date = "2006-01-02T15:04:05Z"
func main() {
compileTime, err := time.Parse(time.RFC3339, date)
if err != nil {
log.Fatalf("Could not parse compilation date: %v", err)
}
app := &cli.App{
Name: "spacectl",
Version: version,
Compiled: compileTime,
Usage: "Programmatic access to Spacelift GraphQL API.",
EnableBashCompletion: true,
Commands: []*cli.Command{
module.Command(),
profile.Command(),
provider.Command(),
runexternaldependency.Command(),
stack.Command(),
whoami.Command(),
versioncmd.Command(version),
workerpools.Command(),
completion.Command(),
blueprint.Command(),
},
}
if err := app.Run(os.Args); err != nil {
log.Fatal(err)
}
}