diff options
| author | Eltrac <hi@guhub.cn> | 2025-11-28 14:50:59 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-11-28 14:50:59 +0800 |
| commit | e1cb96b4ffee8e2cfca76c1b9f055d1d26aabc06 (patch) | |
| tree | 99789578950787e60e2feca4ed0d2fe0e4405e13 | |
| parent | 34c7edaaec449e287530537302d3c7459d93fdec (diff) | |
refactor: move `info` subcommand function back to main command
| -rw-r--r-- | main.go | 24 |
1 files changed, 7 insertions, 17 deletions
@@ -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.", |
