Update root.go, go.mod, and go.sum

This commit is contained in:
up9-github
2021-04-22 10:02:01 +03:00
parent 5bbf541f04
commit 830c4ab670
3 changed files with 7 additions and 185 deletions

View File

@@ -1,6 +1,7 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/up9inc/mizu/cli/config"
"github.com/up9inc/mizu/cli/mizu"
@@ -19,7 +20,11 @@ func init() {
return rootCmd.Help()
}
regex := regexp.MustCompile(args[0]) // TODO: show proper error message when this fails
regex, err := regexp.Compile(args[0])
if err != nil {
fmt.Printf("%s is not a valid regex %s", args[0], err)
return nil
}
mizu.Run(regex)
return nil
}