mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-19 02:39:29 +08:00
feat: init cli command
This commit is contained in:
7
cmd/main/main.go
Normal file
7
cmd/main/main.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "github.com/httprunner/httpboomer/cmd"
|
||||
|
||||
func main() {
|
||||
cmd.Execute()
|
||||
}
|
||||
32
cmd/root.go
Normal file
32
cmd/root.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/httprunner/httpboomer"
|
||||
)
|
||||
|
||||
// rootCmd represents the base command when called without any subcommands
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "httpboomer",
|
||||
Short: "httpboomer = httprunner + boomer",
|
||||
Long: `HttpBoomer is a golang implementation of HttpRunner.
|
||||
Ideally, HttpBoomer will be fully compatible with HttpRunner, including testcase format and usage.
|
||||
What's more, HttpBoomer will integrate Boomer natively to be a better load generator for locust.`,
|
||||
Version: httpboomer.VERSION,
|
||||
// Uncomment the following line if your bare application
|
||||
// has an action associated with it:
|
||||
// Run: func(cmd *cobra.Command, args []string) {},
|
||||
}
|
||||
|
||||
// Execute adds all child commands to the root command and sets flags appropriately.
|
||||
// This is called by main.main(). It only needs to happen once to the rootCmd.
|
||||
func Execute() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user