mirror of
https://github.com/status-im/nim-confutils.git
synced 2025-01-21 09:29:51 +00:00
6a56d01381
you can still set the value of a hidden option, it just dont show up in the help text. but using `ignore`, the is no chance you can set the value from cli.
23 lines
469 B
Nim
23 lines
469 B
Nim
import
|
|
std/unittest,
|
|
../confutils,
|
|
../confutils/defs
|
|
|
|
type
|
|
TestConf* = object
|
|
dataDir* {.
|
|
ignore
|
|
defaultValue: "nimbus"
|
|
name: "data-dir"}: string
|
|
|
|
logLevel* {.
|
|
defaultValue: "DEBUG"
|
|
desc: "Sets the log level."
|
|
name: "log-level" }: string
|
|
|
|
suite "test ignore option":
|
|
test "ignored option have no default value":
|
|
let conf = TestConf.load()
|
|
doAssert(conf.logLevel == "DEBUG")
|
|
doAssert(conf.dataDir == "")
|