summaryrefslogtreecommitdiffstats
path: root/cmd/root.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/root.go')
-rw-r--r--cmd/root.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/root.go b/cmd/root.go
index 890d336..c4239ba 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -8,6 +8,10 @@ import (
"github.com/spf13/cobra"
)
+var (
+ jsonOutput bool
+)
+
var rootCmd = &cobra.Command{
Use: "dborg",
Short: "DB.org.ai CLI client",
@@ -28,4 +32,9 @@ func Execute() {
}
func init() {
+ rootCmd.PersistentFlags().BoolVarP(&jsonOutput, "json", "j", false, "Output raw JSON instead of formatted text")
+}
+
+func IsJSONOutput() bool {
+ return jsonOutput
}