Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
stsem committed Aug 23, 2023
1 parent a12ea62 commit 7d1c435
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ var mode string
var reportName string

func init() {
ExecCmd.Flags().StringVarP(&reportName, "report-name", "n", "", "Custom report name Example: report")
ExecCmd.Flags().BoolVarP(&onlyFail, "only-fail", "f", false, "Only display failed tests")
ExecCmd.Flags().BoolVarP(&report, "report", "r", false, "Generate a report")
ExecCmd.Flags().StringVarP(&reportPath, "report-path", "p", "./", "Path to save the report (default is current directory)")
ExecCmd.Flags().StringVarP(&mode, "mode", "m", "cli", "Run mode (e.g. 'cli', 'ci')")
ExecCmd.Flags().StringVarP(&reportName, "report-name", "n", "", "Custom report name Example: report") // Новый флаг
}

type Exec struct {
Expand Down Expand Up @@ -86,7 +86,7 @@ func checkAndAddFlags(args []string, flags ...string) []string {
// executeCommand executes the given command and formats its output
func executeCommand(cmd *cobra.Command, args []string) {
parsedArgs := parseArguments(args)
parsedArgsWithRequiredFlag := checkAndAddFlags(parsedArgs, "-json", "-v", "-cover")
parsedArgsWithRequiredFlag := checkAndAddFlags(parsedArgs, "--json", "-v", "--cover")
if !strings.Contains(strings.Join(parsedArgsWithRequiredFlag, " "), "go test") {
fmt.Println(textpkg.FgRed.Sprintf("Error: exec command only supports go test commands"))
os.Exit(1)
Expand Down

0 comments on commit 7d1c435

Please sign in to comment.