iffy / nim-argparse

Argument parsing for Nim
MIT License
118 stars 7 forks source link

Importing argparse breaks std/logging #73

Closed TheSimpleZ closed 2 years ago

TheSimpleZ commented 2 years ago

Don't really know if I should be reporting this in the Nim repo or here. However, if I import this library, I'm unable to use the std/logging library.

import std/logging, argparse

addHandler newConsoleLogger()

error "not working"

Compiling this results in:

$ nim c --out:"bin/test" -r "~/Documents/monorepo-manager/pkgs/mono/test.nim"
Hint: used config file '~/.choosenim/toolchains/nim-1.6.2/config/nim.cfg' [Conf]
Hint: used config file '~/.choosenim/toolchains/nim-1.6.2/config/config.nims' [Conf]
Hint: used config file '~/Documents/monorepo-manager/pkgs/mono/config.nims' [Conf]
..................................................................................................
~/Documents/monorepo-manager/pkgs/mono/test.nim(5, 7) Error: 'error' can only be used in compile-time context

Simply removing the argparse import results in a successful compilation.

iffy commented 2 years ago

I think this library can probably fix that. Let me take a look