-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
44 lines (35 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
// Copyright (c) Seth Hoenig
// SPDX-License-Identifier: MIT
package main
import (
"os"
"github.com/shoenig/envy/internal/commands"
"github.com/shoenig/envy/internal/output"
"github.com/shoenig/envy/internal/setup"
"noxide.lol/go/babycli"
)
func main() {
tool := setup.New(
os.Getenv("ENVY_DB_FILE"),
output.New(os.Stdout, os.Stderr),
)
args := babycli.Arguments()
rc := commands.Invoke(args, tool)
os.Exit(rc)
// fs := flag.NewFlagSet(envyGroup, flag.ContinueOnError)
// subs := subcommands.NewCommander(fs, "envy commands")
// subs.Register(subs.HelpCommand(), usageGroup)
// subs.Register(subs.FlagsCommand(), usageGroup)
// subs.Register(commands.NewListCmd(tool), envyGroup)
// subs.Register(commands.NewSetCmd(tool), envyGroup)
// subs.Register(commands.NewPurgeCmd(tool), envyGroup)
// subs.Register(commands.NewShowCmd(tool), envyGroup)
// subs.Register(commands.NewExecCmd(tool), envyGroup)
// if err := fs.Parse(os.Args[1:]); err != nil {
// tool.Writer.Errorf("unable to parse args: %v", err)
// os.Exit(1)
// }
// ctx := context.Background()
// rc := subs.Execute(ctx, fs.Args())
// os.Exit(int(rc))
}