Skip to content

Commit 7e3e331

Browse files
committed
Improved config listings output
1 parent 3c312ea commit 7e3e331

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/repl/conf.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func (r *REPL) handleSetCommand(args []string) error {
312312
fmt.Print("Available options:\r\n")
313313
for _, option := range GetAvailableOptions() {
314314
optType := GetOptionType(option)
315-
fmt.Printf(" %s (%s) - %s\r\n", option, optType, GetOptionDescription(option))
315+
fmt.Printf(" %-20s %-15s %s\r\n", option, "("+optType+")", GetOptionDescription(option))
316316
}
317317
return nil
318318
}
@@ -416,7 +416,7 @@ func (r *REPL) handleGetCommand(args []string) error {
416416
// List all available options and their current values
417417
for _, option := range GetAvailableOptions() {
418418
value := r.config.options.Get(option)
419-
optType := GetOptionType(option)
419+
// optType := GetOptionType(option)
420420

421421
var status string
422422
if value == "" {
@@ -429,9 +429,9 @@ func (r *REPL) handleGetCommand(args []string) error {
429429
} else {
430430
status = value
431431
}
432-
433-
fmt.Printf(" %s = %s (type: %s) - %s\r\n",
434-
option, status, optType, GetOptionDescription(option))
432+
// fmt.Printf(" %-20s %-15s %s\r\n", option, "("+optType+")", GetOptionDescription(option))
433+
fmt.Printf(" %-20s = %-15s\r\n", option, status)
434+
// (type: %s) - %s\r\n", option, status, optType, GetOptionDescription(option))
435435
}
436436
return nil
437437
}

src/repl/tools.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ func extractJSONBlock(text string) (string, string) {
181181
return "", text
182182
}
183183
start := strings.Index(text, "{")
184-
if start != -1 {
184+
if start > 0 {
185185
newText := text[start:]
186186
end := strings.LastIndex(newText, "\n}")
187187
if end != -1 {

0 commit comments

Comments
 (0)