summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-11-28 14:50:59 +0800
committerEltrac <hi@guhub.cn>2025-11-28 14:50:59 +0800
commite1cb96b4ffee8e2cfca76c1b9f055d1d26aabc06 (patch)
tree99789578950787e60e2feca4ed0d2fe0e4405e13 /main.go
parent34c7edaaec449e287530537302d3c7459d93fdec (diff)
refactor: move `info` subcommand function back to main command
Diffstat (limited to 'main.go')
-rw-r--r--main.go24
1 files changed, 7 insertions, 17 deletions
diff --git a/main.go b/main.go
index a2af868..40b2459 100644
--- a/main.go
+++ b/main.go
@@ -28,26 +28,16 @@ func main() {
Destination: &NoCache,
},
},
- // Action: func(ctx context.Context, cmd *cli.Command) error {
+ Action: func(ctx context.Context, cmd *cli.Command) error {
+ if cmd.Args().Len() == 0 {
+ printErrorAndExit("Please provide a formulae/cask name.")
+ }
+ searchAndPrint(cmd.Args().First())
-
- // return nil
- // },
+ return nil
+ },
Commands: []*cli.Command{
{
- Name: "info",
- Aliases: []string{"i"},
- Usage: "Show info and reverse dependencies of a formula/cask.",
- Action: func(ctx context.Context, cmd *cli.Command) error {
- if cmd.Args().Len() == 0 {
- printErrorAndExit("Please provide a formulae/cask name.")
- }
- searchAndPrint(cmd.Args().First())
-
- return nil
- },
- },
- {
Name: "list",
Aliases: []string{"l", "ls"},
Usage: "Better brew list.",