Skip to content

Commit

Permalink
Merge pull request #77 from kitagry/fix-diff-command
Browse files Browse the repository at this point in the history
Fix diff command
  • Loading branch information
tkuchiki committed Aug 15, 2023
2 parents 2ba80ec + 70c89c4 commit df82f8e
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions cmd/alp/cmd/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,20 @@ import (
)

func NewDiffCmd(rootCmd *cobra.Command) *cobra.Command {
var diffCmd = &cobra.Command{
diffCmd := &cobra.Command{
Use: "diff <from> <to>",
Args: cobra.ExactArgs(2),
Short: "Show the difference between the two profile results",
Long: `Show the difference between the two profile results`,
RunE: func(cmd *cobra.Command, args []string) error {
sortOptions := stats.NewSortOptions()
opts, err := createOptions(rootCmd, sortOptions)
opts, err := createOptions(cmd, sortOptions)
if err != nil {
return err
}

from, err := cmd.PersistentFlags().GetString("from")
if err != nil {
return err
}

to, err := cmd.PersistentFlags().GetString("to")
if err != nil {
return err
}
from := args[0]
to := args[1]

sts := stats.NewHTTPStats(true, false, false)

Expand Down Expand Up @@ -85,11 +78,7 @@ func NewDiffCmd(rootCmd *cobra.Command) *cobra.Command {
},
}

//app.Arg("from", "").Required().StringVar(&f.From)
//app.Arg("to", "").Required().StringVar(&f.To)

diffCmd.PersistentFlags().StringP("from", "", "", "The comparison source file")
diffCmd.PersistentFlags().StringP("to", "", "", "The comparison target file")
defineOptions(diffCmd)

return diffCmd
}

0 comments on commit df82f8e

Please sign in to comment.