From e1cb96b4ffee8e2cfca76c1b9f055d1d26aabc06 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Fri, 28 Nov 2025 14:50:59 +0800 Subject: refactor: move `info` subcommand function back to main command --- main.go | 24 +++++++----------------- 1 file 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.", -- cgit v1.2.3