Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve cli help
  • Loading branch information
rs committed Mar 9, 2018
1 parent 3f7298f commit 60c6daa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -101,7 +101,7 @@ jplot --url http://:8080/debug/vars \

### Vegeta

With the help of [jaggr](https://github.com/rs/jaggr] can be used to integrate [vegeta](https://github.com/tsenart/vegeta) with jplot as follow:
With the help of [jaggr](https://github.com/rs/jaggr) can be used to integrate [vegeta](https://github.com/tsenart/vegeta) with jplot as follow:

```
echo 'GET http://localhost:8080' | \
Expand Down
14 changes: 14 additions & 0 deletions main.go
Expand Up @@ -16,6 +16,20 @@ import (
)

func main() {
flag.Usage = func() {
out := flag.CommandLine.Output()
fmt.Fprintln(out, "Usage: jplot [OPTIONS] FIELD_SPEC [FIELD_SPEC...]:")
fmt.Fprintln(out, "")
fmt.Fprintln(out, "OPTIONS:")
flag.PrintDefaults()
fmt.Fprintln(out, "")
fmt.Fprintln(out, "FIELD_SPEC: [<option>[,<option>...]:]path")
fmt.Fprintln(out, " option:")
fmt.Fprintln(out, " - counter: Computes the difference with the last value. The value must increase monotonically.")
fmt.Fprintln(out, " - marker: When the value is none-zero, a vertical line is drawn.")
fmt.Fprintln(out, " path:")
fmt.Fprintln(out, " JSON field path (eg: field.sub-field).")
}
url := flag.String("url", "", "URL to fetch every second. Read JSON objects from stdin if not specified.")
interval := flag.Duration("interval", time.Second, "When url is provided, defines the interval between fetches."+
" Note that counter fields are computed based on this interval.")
Expand Down

0 comments on commit 60c6daa

Please sign in to comment.