diff --git a/confutils.nimble b/confutils.nimble index 6e22db7..2ffe469 100644 --- a/confutils.nimble +++ b/confutils.nimble @@ -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" diff --git a/tests/logger.nim b/tests/logger.nim new file mode 100644 index 0000000..42a5ad1 --- /dev/null +++ b/tests/logger.nim @@ -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 + diff --git a/tests/nested_commands.nim b/tests/nested_commands.nim index 96943a6..33ebb23 100644 --- a/tests/nested_commands.nim +++ b/tests/nested_commands.nim @@ -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: