HTTP load generator, ApacheBench (ab) replacement
Go
Change output command format
Pascal Hakim2988b28c95ee
diff --git a/commands/print.go b/commands/print.goindex 6e25b82..2e31fa5 100644--- a/commands/print.go+++ b/commands/print.go@@ -70,7 +70,7 @@ func (r *report) print() {if len(r.lats) > 0 {sort.Float64s(r.lats)- if r.output == "txt" {+ if r.output == "" {r.fastest = r.lats[0]r.slowest = r.lats[len(r.lats)-1]fmt.Printf("\nSummary:\n")diff --git a/main.go b/main.goindex cbfa1a9..330f137 100644--- a/main.go+++ b/main.go@@ -32,7 +32,7 @@ var (flagType = flag.String("T", "text/html", "")flagAuth = flag.String("a", "", "")flagInsecure = flag.Bool("allow-insecure", false, "")- flagOutput = flag.String("o", "txt", "")+ flagOutput = flag.String("o", "", "")flagC = flag.Int("c", 50, "")flagN = flag.Int("n", 200, "")@@ -56,7 +56,7 @@ Options:-allow-insecure Allow bad/expired TLS/SSL certificates.- -o Output type, one of txt, csv+ -o Output type: csv`func main() {@@ -114,7 +114,7 @@ func main() {req.SetBasicAuth(matches[0][1], matches[0][2])}- if *flagOutput != "csv" && *flagOutput != "txt" {+ if *flagOutput != "csv" && *flagOutput != "" {usageAndExit()}