Skip to content

Commit

Permalink
feat(cmd/root): Add optional JSON output (using --json)
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejsika committed Aug 3, 2021
1 parent 66a5473 commit 2e1ea82
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/root/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@ import (
"github.com/spf13/cobra"
)

var RootCmdFlagJson bool

var RootCmd = &cobra.Command{
Use: "slut",
Short: "SikaLabs Utils",
}

func init() {
RootCmd.PersistentFlags().BoolVar(
&RootCmdFlagJson,
"json",
false,
"Formatu output to JSON",
)
}

0 comments on commit 2e1ea82

Please sign in to comment.