From 60c6daacd2d173bcfaa45150bdca1556cde35574 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Thu, 8 Mar 2018 21:36:47 -0800 Subject: [PATCH] Improve cli help --- README.md | 2 +- main.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 856c8ef..fc0daed 100644 --- a/README.md +++ b/README.md @@ -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' | \ diff --git a/main.go b/main.go index f50359a..adc4826 100644 --- a/main.go +++ b/main.go @@ -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: [