Skip to content

Commit

Permalink
feat: removed column Default from the command options list and added …
Browse files Browse the repository at this point in the history
…info about changed value

FossilOrigin-Name: 8a2379ad82d75176a8f33671a00ff84a1a3e832dd52f3894d7923f7f8abe7348
  • Loading branch information
thindil committed Dec 18, 2023
1 parent 9890c23 commit 56996e7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/options.nim
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,8 @@ proc showOptions*(db): ResultCode {.sideEffect, raises: [], tags: [
try:
let color: string = getColor(db = db, name = tableHeaders)
table.add(parts = [style(ss = "Name", style = color), style(ss = "Value",
style = color), style(ss = "Default", style = color), style(
ss = "Type", style = color), style(ss = "Description",
style = color)])
style = color), style(ss = "Type", style = color), style(
ss = "Description", style = color)])
except UnknownEscapeError, InsufficientInputError, FinalByteError:
return showError(message = "Can't show options list. Reason: ",
e = getCurrentException(), db = db)
Expand All @@ -218,11 +217,13 @@ proc showOptions*(db): ResultCode {.sideEffect, raises: [], tags: [
objs = options)
let color: string = getColor(db = db, name = default)
for option in options:
var value: string = option.value
if value != option.defaultValue:
value &= " (changed)"
table.add(parts = [style(ss = option.option, style = getColor(db = db,
name = ids)), style(ss = option.value, style = getColor(db = db,
name = values)), style(ss = option.defaultValue, style = color),
style(ss = $option.valueType, style = color), style(ss =
option.description, style = color)])
name = ids)), style(ss = value, style = getColor(db = db,
name = values)), style(ss = $option.valueType, style = color),
style(ss = option.description, style = color)])
except:
return showError(message = "Can't show the shell's options. Reason: ",
e = getCurrentException(), db = db)
Expand Down

0 comments on commit 56996e7

Please sign in to comment.