diff options
| author | s <[email protected]> | 2025-11-26 09:06:15 -0500 |
|---|---|---|
| committer | s <[email protected]> | 2025-11-26 09:06:15 -0500 |
| commit | 7d6eb2f1a38e2265751cd61a43769959405866b4 (patch) | |
| tree | 99eba2542cd2ba6f30d6e2ad1c3fc53bcb5b5901 /cmd | |
| parent | cbc521467a3cca7a17e6f691a9c7fa34f4da3e24 (diff) | |
| download | dborg-7d6eb2f1a38e2265751cd61a43769959405866b4.tar.gz dborg-7d6eb2f1a38e2265751cd61a43769959405866b4.zip | |
feat: add debug flag to enable raw api response output
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/helpers.go | 4 | ||||
| -rw-r--r-- | cmd/root.go | 8 | ||||
| -rw-r--r-- | cmd/sl.go | 2 |
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 +} @@ -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") } |
