Skip to content

Commit 3f69e69

Browse files
committed
Support NO_COLOR to default plain to false.
1 parent 9102b34 commit 3f69e69

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lc.nim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ type # fileName Dtype Stat lnTgt ACL Magic Capability
5757
###### Documentation/CLI; Early to use lsCfFromCL in for local config tweaks.
5858
const nimbleFile = staticRead "lc.nimble"
5959
clCfg.version = nimbleFile.fromNimble "version"
60-
let cfDfl* = LsCf(format:"%f", glyph:" -> ", recurse:1, nColumn:999, padMax:999)
60+
proc c_getenv(env: cstring): cstring {.importc: "getenv", header: "<stdlib.h>".}
61+
let cfDfl* = LsCf(format: "%f", glyph: " -> ", recurse: 1, nColumn: 999,
62+
padMax: 999, plain: (c_getenv("NO_COLOR") != nil))
6163

6264
const ess: seq[string] = @[]
6365
initGen(cfDfl, LsCf, "paths", @["ALL AFTER paths"], "inLsCf")

0 commit comments

Comments
 (0)