forked from HUMANS-ORG/funk-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
38 lines (34 loc) · 770 Bytes
/
Copy pathmain.go
File metadata and controls
38 lines (34 loc) · 770 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
package main
import (
"context"
"fmt"
"funk/commands"
"log"
"os"
"strings"
"github.com/urfave/cli/v3"
)
func main() {
cmd := &cli.Command{
Name: "funk",
Usage: "suite of useful tools for pesky problems",
Commands: []*cli.Command{
commands.ConvertCommand(),
commands.TimerCommand(),
commands.Todos(),
commands.Isps(),
commands.FileDetectCommand(),
commands.Morph(),
},
OnUsageError: func(ctx context.Context, cmd *cli.Command, err error, isSubcommand bool) error {
if strings.Contains(err.Error(), "invalid value") {
fmt.Println("❌ Invalid input: seconds must be an integer (e.g., --s 10)")
return nil
}
return err
},
}
if err := cmd.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
}
}