-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
39 lines (35 loc) · 700 Bytes
/
Copy pathmain.go
File metadata and controls
39 lines (35 loc) · 700 Bytes
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
// Main entry point for Rancher.
//
// Notes on code in Main: some of the code in runMain is copied from the copy-
// right holder, Mitchell Hashimoto (github.com/mitchellh), as I am using his
// cli package.
package main
import (
"fmt"
"os"
"github.com/mohae/cli"
"github.com/mohae/feedlot/conf"
)
func main() {
os.Exit(realMain())
}
func realMain() int {
err := conf.SetAppConfFile()
if err != nil {
fmt.Println(err)
return 1
}
args := os.Args[1:]
cli := &cli.CLI{
Name: conf.Name,
Version: Version,
Args: args,
Commands: Commands,
HelpFunc: cli.BasicHelpFunc(conf.Name),
}
exitCode, err := cli.Run()
if err != nil {
fmt.Println(err)
}
return exitCode
}