forked from lhcb-org/lbpkr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
53 lines (45 loc) · 1.13 KB
/
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
48
49
50
51
52
53
package main
import (
"os"
"github.com/gonuts/commander"
"github.com/gonuts/flag"
)
var g_cmd *commander.Command
var g_ctx *Context
func init() {
g_cmd = &commander.Command{
UsageLine: "lbpkr",
Short: "installs software in MYSITEROOT directory.",
Subcommands: []*commander.Command{
lbpkr_make_cmd_check(),
lbpkr_make_cmd_deps(),
lbpkr_make_cmd_dep_graph(),
lbpkr_make_cmd_install(),
lbpkr_make_cmd_installed(),
lbpkr_make_cmd_list(),
lbpkr_make_cmd_provides(),
lbpkr_make_cmd_remove(),
lbpkr_make_cmd_rpm(),
lbpkr_make_cmd_self(),
lbpkr_make_cmd_update(),
lbpkr_make_cmd_version(),
},
Flag: *flag.NewFlagSet("lbpkr", flag.ContinueOnError),
}
}
func main() {
var args []string
err := g_cmd.Flag.Parse(os.Args[1:])
if err != nil || err == flag.ErrHelp {
args = []string{"help"}
} else {
args = g_cmd.Flag.Args()
}
err = g_cmd.Dispatch(args)
handle_err(err)
}
func add_default_options(cmd *commander.Command) {
cmd.Flag.String("siteroot", "", "path to site installation")
cmd.Flag.Bool("v", false, "enable verbose mode")
cmd.Flag.String("type", "lhcb", "config type (lhcb|atlas)")
}