Skip to content

Commit

Permalink
Add long options
Browse files Browse the repository at this point in the history
  • Loading branch information
genkiroid committed Apr 9, 2018
1 parent 3b9272f commit 29af8cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -85,13 +85,19 @@ Error:
## Options

```sh
$ cert -h
$ cert --help
Usage of cert:
-f string
Output format. md: as markdown, json: as JSON. (default "simple table")
-format string
Output format. md: as markdown, json: as JSON. (default "simple table")
-k Skip verification of server's certificate chain and host name.
-skip-verify
Skip verification of server's certificate chain and host name.
-t string
Output format as Go template string or Go template file path.
-template string
Output format as Go template string or Go template file path.
-v Show version.
-version
Show version.
Expand Down
11 changes: 7 additions & 4 deletions cmd/cert/main.go
Expand Up @@ -11,16 +11,19 @@ import (
var version = ""

func main() {
var skipVerify bool
var format string
var showVersion bool
var template string
var skipVerify bool
var showVersion bool

flag.BoolVar(&skipVerify, "k", false, "Skip verification of server's certificate chain and host name.")
flag.StringVar(&format, "f", "simple table", "Output format. md: as markdown, json: as JSON. ")
flag.StringVar(&format, "format", "simple table", "Output format. md: as markdown, json: as JSON. ")
flag.StringVar(&template, "t", "", "Output format as Go template string or Go template file path.")
flag.StringVar(&template, "template", "", "Output format as Go template string or Go template file path.")
flag.BoolVar(&skipVerify, "k", false, "Skip verification of server's certificate chain and host name.")
flag.BoolVar(&skipVerify, "skip-verify", false, "Skip verification of server's certificate chain and host name.")
flag.BoolVar(&showVersion, "v", false, "Show version.")
flag.BoolVar(&showVersion, "version", false, "Show version.")
flag.StringVar(&template, "t", "", "Output format as Go template string or Go template file path.")
flag.Parse()

if showVersion {
Expand Down

0 comments on commit 29af8cd

Please sign in to comment.