diff --git a/mysql/main.go b/mysql/main.go index f673e3a..ba9faa0 100644 --- a/mysql/main.go +++ b/mysql/main.go @@ -2,6 +2,7 @@ package mysql import ( "zenit/mysql/digest" + "zenit/mysql/top" "github.com/spf13/cobra" ) @@ -16,6 +17,7 @@ func NewCommand() *cobra.Command { } cmd.AddCommand(digest.NewCommand()) + cmd.AddCommand(top.NewCommand()) return cmd } diff --git a/mysql/top/main.go b/mysql/top/main.go new file mode 100644 index 0000000..32ad0fa --- /dev/null +++ b/mysql/top/main.go @@ -0,0 +1,21 @@ +package top + +import ( + "github.com/spf13/cobra" +) + +func NewCommand() *cobra.Command { + var cmd = &cobra.Command{ + Use: "top [IDENTIFIER]", + Short: "Display MySQL server performance info like 'top'.", + Run: func(cmd *cobra.Command, args []string) { + if len(args) != 1 { + cmd.Help() + return + } + + }, + } + + return cmd +}