Created
January 7, 2016 03:14
-
-
Save hnakamur/f44eb31d8852ed222c5f to your computer and use it in GitHub Desktop.
An example of parsing a repeated argument like '-vvv' with kingpin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"gopkg.in/alecthomas/kingpin.v2" | |
) | |
var ( | |
verbose = kingpin.Flag("verbose", "Enable verbose mode.").Short('v').Counter() | |
) | |
func main() { | |
kingpin.Version("0.0.1") | |
kingpin.Parse() | |
fmt.Printf("verbose=%v\n", *verbose) | |
} |
Author
hnakamur
commented
Jan 7, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment