2020-06-16 15:22:41 +00:00
|
|
|
import
|
|
|
|
confutils, options
|
|
|
|
|
|
|
|
type
|
|
|
|
Cmd = enum
|
|
|
|
fizz = "command A"
|
|
|
|
buzz = "command B"
|
|
|
|
|
|
|
|
Conf = object
|
|
|
|
case cmd {.command.}: Cmd
|
|
|
|
of fizz:
|
|
|
|
option {.desc: "some option".}: Option[string]
|
2021-05-16 18:42:12 +00:00
|
|
|
anotherOption {.desc: "another option"
|
|
|
|
defaultValue: "some value".}: string
|
|
|
|
thirdOption {.desc: "third option"
|
|
|
|
defaultValue: "another value"
|
|
|
|
defaultValueDesc: "some description".}: string
|
2020-06-16 15:22:41 +00:00
|
|
|
arg1 {.
|
|
|
|
argument
|
|
|
|
desc: "argument 1" .}: string
|
|
|
|
argument2 {.
|
|
|
|
argument
|
|
|
|
desc: "argument 2" .}: int
|
|
|
|
of buzz:
|
|
|
|
discard
|
|
|
|
|
|
|
|
echo load(Conf)
|