/
main.go
42 lines (34 loc) · 977 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
package main
import (
"os"
"sort"
"fmt"
"github.com/urfave/cli"
)
func main() {
app := cli.NewApp()
app.Name = Name
app.Version = Version
app.Author = "bjwschaap"
app.Email = "bastiaan.schaap@gmail.com"
app.Usage = `Enver simply parses files (specified in enver.conf), and replaces
placeholders in the form: ${env.MY_VAR} with the value found in environment
variable MY_VAR. Optionally a default value can be provided using the pipe
symbol. E.g.: ${env.MY_VAR|1234}. If there is no environment variable MY_VAR
enver will replace with default value '1234'. Make enver very quiet by passing
-q.`
app.Flags = GlobalFlags
app.Commands = Commands
app.CommandNotFound = CommandNotFound
cli.VersionFlag = cli.BoolFlag{
Name: "version, V",
Usage: "Only print version, and exit.",
}
sort.Sort(cli.FlagsByName(app.Flags))
sort.Sort(cli.CommandsByName(app.Commands))
err := app.Run(os.Args)
if err != nil {
fmt.Printf("%v\n", err)
os.Exit(1)
}
}