summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/helpers.go4
-rw-r--r--cmd/root.go8
-rw-r--r--cmd/sl.go2
3 files changed, 10 insertions, 4 deletions
diff --git a/cmd/helpers.go b/cmd/helpers.go
index f53f235..133fb0a 100644
--- a/cmd/helpers.go
+++ b/cmd/helpers.go
@@ -8,11 +8,11 @@ import (
)
func newClient() (*client.Client, error) {
- return client.New(config.New())
+ return client.New(config.New().WithDebug(debugOutput))
}
func newUnauthenticatedClient() (*client.Client, error) {
- return client.NewUnauthenticated(config.New())
+ return client.NewUnauthenticated(config.New().WithDebug(debugOutput))
}
func checkError(errorMsg string) error {
diff --git a/cmd/root.go b/cmd/root.go
index c4239ba..292e96d 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -9,7 +9,8 @@ import (
)
var (
- jsonOutput bool
+ jsonOutput bool
+ debugOutput bool
)
var rootCmd = &cobra.Command{
@@ -33,8 +34,13 @@ func Execute() {
func init() {
rootCmd.PersistentFlags().BoolVarP(&jsonOutput, "json", "j", false, "Output raw JSON instead of formatted text")
+ rootCmd.PersistentFlags().BoolVarP(&debugOutput, "debug", "d", false, "Enable debug output (shows raw API responses)")
}
func IsJSONOutput() bool {
return jsonOutput
}
+
+func IsDebugOutput() bool {
+ return debugOutput
+}
diff --git a/cmd/sl.go b/cmd/sl.go
index 8c43506..1c8de09 100644
--- a/cmd/sl.go
+++ b/cmd/sl.go
@@ -23,7 +23,7 @@ func init() {
slCmd.Flags().StringP("ingest_start_date", "i", "", "Ingest timestamp start date")
slCmd.Flags().StringP("ingest_end_date", "e", "", "Ingest timestamp end date")
slCmd.Flags().StringP("posted_start_date", "p", "", "Date posted start date")
- slCmd.Flags().StringP("posted_end_date", "d", "", "Date posted end date")
+ slCmd.Flags().StringP("posted_end_date", "D", "", "Date posted end date")
slCmd.Flags().StringP("format", "f", "json", "Response format")
}