Fix a test using obsolete pragmas
This commit is contained in:
parent
24c73359b0
commit
d5bcca04da
|
@ -7,6 +7,13 @@ description = "Simplified handling of command line options and config files"
|
|||
license = "Apache License 2.0"
|
||||
skipDirs = @["tests"]
|
||||
|
||||
requires "nim >= 0.19.0",
|
||||
"stew"
|
||||
requires "nim >= 1.0.0",
|
||||
"stew",
|
||||
"testutils"
|
||||
|
||||
task test, "run CPU tests":
|
||||
when defined(windows):
|
||||
exec "cmd.exe /C testrunner.cmd tests"
|
||||
else:
|
||||
exec "testrunner tests"
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import
|
||||
../confutils
|
||||
|
||||
type
|
||||
Command = enum
|
||||
pubsub = "A pub sub command"
|
||||
|
||||
Conf = object
|
||||
logDir: string
|
||||
case cmd {.command.}: Command
|
||||
of pubsub:
|
||||
foo: string
|
||||
|
||||
let c = load Conf
|
||||
echo c.cmd
|
||||
|
|
@ -22,7 +22,7 @@ type
|
|||
commonOptional: Option[string]
|
||||
commonMandatory {.
|
||||
desc: "A mandatory option"
|
||||
shortform: "m" .}: int
|
||||
abbr: "m" .}: int
|
||||
|
||||
case opt: OuterOpt
|
||||
of outerOpt1:
|
||||
|
@ -42,7 +42,7 @@ type
|
|||
ic1Mandatory: string
|
||||
ic1Optional {.
|
||||
desc: "Delay in seconds"
|
||||
shortform: "s" .}: Option[int]
|
||||
abbr: "s" .}: Option[int]
|
||||
else:
|
||||
discard
|
||||
of outerCmd2:
|
||||
|
|
Loading…
Reference in New Issue