@@ -48,12 +48,13 @@ proc writeError(message: string) =
4848 stderr.writeLine (" Error: " & message)
4949 quit (1 )
5050
51- proc parseArgs (): (string , string , int , string , bool , OutputFormat , seq [string ]) =
51+ proc parseArgs (): (string , string , int , string , bool , bool , OutputFormat , seq [string ]) =
5252 var command = " "
5353 var hostname = " localhost"
5454 var port = 8080
5555 var apiVersion = " v0"
5656 var insecure = false
57+ var debug = false
5758 var outputFormat = OutputFormat .Text
5859 var args: seq [string ] = @ []
5960
@@ -91,6 +92,8 @@ proc parseArgs(): (string, string, int, string, bool, OutputFormat, seq[string])
9192 args.add (" --id=" & val)
9293 of " insecure" :
9394 insecure = true
95+ of " debug" :
96+ debug = true
9497 of " output" , " o" :
9598 if val.len == 0 :
9699 writeError (" Output option requires a value (text, json, or yaml)" )
@@ -116,7 +119,11 @@ proc parseArgs(): (string, string, int, string, bool, OutputFormat, seq[string])
116119 writeHelp ()
117120 quit (0 )
118121
119- (command, hostname, port, apiVersion, insecure, outputFormat, args)
122+ # Also check for DEBUG environment variable
123+ if existsEnv (" DEBUG" ):
124+ debug = true
125+
126+ (command, hostname, port, apiVersion, insecure, debug, outputFormat, args)
120127
121128proc formatOutput * [T](data: T, outputFormat: OutputFormat ) =
122129 # # Format data according to output format preference
@@ -354,9 +361,9 @@ proc handleCredentialCommand(client: GodonClient, command: string, args: seq[str
354361 else :
355362 writeError (" Unknown credential command: " & subCommand)
356363
357- let (command, hostname, port, apiVersion, insecure, outputFormat, args) = parseArgs ()
364+ let (command, hostname, port, apiVersion, insecure, debug, outputFormat, args) = parseArgs ()
358365
359- let godonClient = newGodonClient (hostname, port, apiVersion, insecure)
366+ let godonClient = newGodonClient (hostname, port, apiVersion, insecure, debug )
360367
361368case command:
362369of " breeder" :
0 commit comments