Skip to content

Commit

Permalink
Change format flag to enum and improve the description to list the fo…
Browse files Browse the repository at this point in the history
…rmats available
  • Loading branch information
bojand committed Apr 7, 2019
1 parent c985586 commit f467e36
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Flags:
--stream-interval=0 Interval for stream requests between message sends.
--reflect-metadata= Reflect metadata as stringified JSON used only for reflection request.
-o, --output= Output path. If none provided stdout is used.
-O, --format= Output format. If none provided, a summary is printed.
-O, --format= Output format. One of: summary, csv, json, pretty, html, influx-summary, influx-details. Default is summary.
--connect-timeout=10 Connection timeout in seconds for the initial connection dial. Default is 10.
--keepalive=0 Keepalive time in seconds. Only used if present and above 0.
--name= User specified name for the test.
Expand Down
2 changes: 1 addition & 1 deletion cmd/ghz/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ var (
rmd = kingpin.Flag("reflect-metadata", "Reflect metadata as stringified JSON used only for reflection request.").PlaceHolder(" ").String()

output = kingpin.Flag("output", "Output path. If none provided stdout is used.").Short('o').PlaceHolder(" ").String()
format = kingpin.Flag("format", "Output format. If none provided, a summary is printed.").Short('O').PlaceHolder(" ").String()
format = kingpin.Flag("format", "Output format. One of: summary, csv, json, pretty, html, influx-summary, influx-details. Default is summary.").Short('O').Default("summary").PlaceHolder(" ").Enum("summary", "csv", "json", "pretty", "html", "influx-summary", "influx-details")

ct = kingpin.Flag("connect-timeout", "Connection timeout in seconds for the initial connection dial. Default is 10.").Default("10").Uint()
kt = kingpin.Flag("keepalive", "Keepalive time in seconds. Only used if present and above 0.").Default("0").Uint()
Expand Down
2 changes: 1 addition & 1 deletion printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type ReportPrinter struct {
// Otherwise the summary of results is printed.
func (rp *ReportPrinter) Print(format string) error {
switch format {
case "", "csv":
case "summary", "csv":
outputTmpl := defaultTmpl
if format == "csv" {
outputTmpl = csvTmpl
Expand Down
2 changes: 2 additions & 0 deletions www/docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ id: output
title: Output
---

<AUTOGENERATED_TABLE_OF_CONTENTS>

### Summary

Sample standard output of summary of the results:
Expand Down
2 changes: 1 addition & 1 deletion www/docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Flags:
--stream-interval=0 Interval for stream requests between message sends.
--reflect-metadata= Reflect metadata as stringified JSON used only for reflection request.
-o, --output= Output path. If none provided stdout is used.
-O, --format= Output format. If none provided, a summary is printed.
-O, --format= Output format. One of: summary, csv, json, pretty, html, influx-summary, influx-details. Default is summary.
--connect-timeout=10 Connection timeout in seconds for the initial connection dial. Default is 10.
--keepalive=0 Keepalive time in seconds. Only used if present and above 0.
--name= User specified name for the test.
Expand Down

0 comments on commit f467e36

Please sign in to comment.