Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions cli/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ var (
const (
tuiPageSize = 20
minTagsForComparison = 2

// 3 occurrences requires a const
base = "base"
current = "current"
)

// CreateRootCmd creates and returns the root cobra command.
Expand All @@ -51,10 +55,43 @@ func CreateRootCmd() *cobra.Command {
rootCmd.AddCommand(createTuiCmd())
rootCmd.AddCommand(createSetupCmd())
rootCmd.AddCommand(createTrackCmd())
rootCmd.AddCommand(createToolsCmd())

return rootCmd
}

func createToolsCmd() *cobra.Command {
shortExplanation := "Offers many tools that can easily operate on the collected data."
cmd := &cobra.Command{
Use: "tools",
Short: shortExplanation,
}

cmd.AddCommand(createBenchStatCmd())

return cmd
}

func createBenchStatCmd() *cobra.Command {
baseTagFlag := base
currentFlag := current
shortExplanation := "runs benchstat on txt collected data."

cmd := &cobra.Command{
Use: "benchstats",
Short: shortExplanation,
// RunE: ,
}

cmd.Flags().StringVar(&Baseline, baseTagFlag, "", "Name of the baseline tag")
cmd.Flags().StringVar(&Current, currentFlag, "", "Name of the current tag")

_ = cmd.MarkFlagRequired(baseTagFlag)
_ = cmd.MarkFlagRequired(currentFlag)

return cmd
}

func createProfManual() *cobra.Command {
manualCmd := &cobra.Command{
Use: internal.MANUALCMD,
Expand Down
1 change: 1 addition & 0 deletions engine/tools/api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package tools
1 change: 1 addition & 0 deletions engine/tools/helpers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package tools
Loading