-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
47 lines (34 loc) · 893 Bytes
/
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
// Copyright (C) 2017, 2018 Damon Revoe. All rights reserved.
// Use of this source code is governed by the MIT
// license, which can be found in the LICENSE file.
// +build !windows
package main
import (
"bytes"
"go/doc"
"log"
"os"
"github.com/spf13/cobra"
)
var appName = "autoforge"
var pkgPathEnvVar = "AUTOFORGE_PKG_PATH"
func wrapText(text string) string {
var buffer bytes.Buffer
doc.ToText(&buffer, text, "", " ", 80)
return buffer.String()
}
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: appName,
Short: "Project generator for GNU Autotools",
}
func main() {
// Suppress timestamps in the log messages.
log.SetFlags(0)
// Use application name for the log prefix.
log.SetPrefix(appName + ": ")
// Parse and process command line arguments.
if rootCmd.Execute() != nil {
os.Exit(1)
}
}