-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
40 lines (34 loc) · 726 Bytes
/
main.go
File metadata and controls
40 lines (34 loc) · 726 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
40
package main
import (
"flag"
"fmt"
"math/rand"
"os"
"time"
"aresjob-initializer/cache"
"aresjob-initializer/manual"
"github.com/golang/glog"
"github.com/spf13/cobra"
)
var (
rootCmd = &cobra.Command{
Short: "Initializer for a panda record",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
// For cobra + glog flags. Available to all subcommands.
flag.Parse()
},
}
)
func main() {
rand.Seed(time.Now().UnixNano())
defer glog.Flush()
rootCmd.AddCommand(cache.CacheCmd)
rootCmd.AddCommand(manual.MpiCmd)
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "error: %v\n", err)
os.Exit(1)
}
}
func init() {
rootCmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
}