Verbose flag added

This commit is contained in:
Olivier 2016-12-20 09:04:32 -05:00
parent c5811d75b7
commit 020ac7a6fb
No known key found for this signature in database
GPG key ID: 1A9FE7C1DFF65CB0
3 changed files with 48 additions and 1 deletions

View file

@ -8,9 +8,12 @@ import (
"otremblay.com/jkl"
)
var verbose = flag.Bool("v", false, "Output debug information about jkl")
func main() {
jkl.FindRCFile()
flag.Parse()
jkl.Verbose = verbose
if len(flag.Args()) == 0 {
fmt.Print(usage)
return
@ -23,6 +26,9 @@ func main() {
func runcmd(args []string) error {
switch args[0] {
case "list":
if *verbose {
fmt.Println("Running List command")
}
lcmd, err := NewListCmd(flag.Args()[1:])
if err != nil {
return err