c-blake / cligen

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at
https://c-blake.github.io/cligen/
ISC License
509 stars 24 forks source link

argcvt.nim(5, 31) Error: cannot open file: cligen/textUt #88

Closed pb-cdunn closed 5 years ago

pb-cdunn commented 5 years ago
foo.nim(9, 11) template/generic instantiation from here
../repos/cligen/cligen.nim(673, 14) template/generic instantiation from here
../repos/cligen/cligen/argcvt.nim(5, 31) Error: cannot open file: cligen/textUt

cligen is a symlink to ../repos/cligen, and ../repos/cligen is where I check-out your sub-modules.

foo.nim:

import "cligen/cligen"

cligen.nim:

  1 import macros, tables, cligen/parseopt3, strutils, os

argcvt.nim:

  5 import strformat, sets, cligen/textUt, parseopt3

The fix is to use relative imports. (Maybe this is some other fix?) I'll post a PR ...

c-blake commented 5 years ago

There was a time when parseopt3, argcvt, and cligen all lived up a level but textUt did not which is where that "cligen/" came from. Back in 2015 when I started, I had been hoping that nimble might grow to impose less project structure, like letting you declare multiple exported modules and also perhaps hoping the stdlib might take parseopt3 leaving just cligen and argcvt on equal footing (with the idea that argcvt might be usable in other contexts, but cligen wouldn't make sense without argcvt and without proliferating packages). When neither of those seemed likely to ever happen and people complained about nimble warnings Re project structure, I just put everything under cligen/ except cligen.nim. I missed the cligen/textUt change I should have made back then. Thanks for catching this.

Let me know if this doesn't fix your problem.