summaryrefslogtreecommitdiff
path: root/cmd/gomplate/main.go
blob: 17caa9e256629d4fc4aacd6e36eb500cd34cca2a (plain)
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
/*
The gomplate command
*/
package main

import (
	"context"
	"os"

	"github.com/hairyhenderson/gomplate/v4/internal/cmd"
)

func main() {
	if err := run(); err != nil {
		os.Exit(1)
	}
}

func run() error {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()

	// need to strip os.Args[0] so we only pass the actual flags
	return cmd.Main(ctx, os.Args[1:], os.Stdin, os.Stdout, os.Stderr)
}