Add a helper for obtaining a default configuration

This commit is contained in:
Zahary Karadjov 2019-06-10 22:42:42 +03:00
parent 5ee45828fa
commit da24be1a9d
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609

View File

@ -410,6 +410,9 @@ proc load*(Configuration: type,
if cmd.defaultSubCommand != -1:
result.processMissingOptions(addr cmd.subCommands[cmd.defaultSubCommand])
proc defaults*(Configuration: type): Configuration =
load(Configuration, cmdLine = @[], printUsage = false, quitOnFailure = false)
proc dispatchImpl(cliProcSym, cliArgs, loadArgs: NimNode): NimNode =
# Here, we'll create a configuration object with fields matching
# the CLI proc params. We'll also generate a call to the designated