c-blake / cligen

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

Fix 88 #89

Closed pb-cdunn closed 5 years ago

pb-cdunn commented 5 years ago

Background here: https://github.com/jangko/msgpack4nim/issues/30

Also note araq's comment here: https://forum.nim-lang.org/t/4681#29195 But I don't think that problem is related.

pb-cdunn commented 5 years ago

I see your fix here: https://github.com/c-blake/cligen/commit/9c2d41955b63be7a9802aad4381a374fc6859638

Trying that instead now ...

pb-cdunn commented 5 years ago

(This was a fix for #88.)

c-blake commented 5 years ago

For what it's worth, at least according to the docs for module search paths, that "./" is not syntactically necessary, though it may represent useful meaning to a human reader of the code emphasizing locality of the module. I don't set up symlinks like you, though, and it's possible there are bugs. So, let me know if it breaks without the "./".

pb-cdunn commented 5 years ago

Could you link the docs on search-path? I was looking for that but didn't find it.

c-blake commented 5 years ago

Well, it's in doc/nimc.rst in the distribution. In-file-search for "Search path handling" to get to the section.

c-blake commented 5 years ago

I agree that the "Collective imports from a directory" section in the manual that gets HTML-ified could use a few sentences about this (or maybe a new section just before it?). I find it hard to imagine that Araq would reject such a PR if you sent one, though you may have to iterate on the exact language. Also, I think it's possible to import out of band from the .nim codebase from within nim.cfg (and probably config.nims). tests/import_in_config and tests/modules show that, but I doubt it's documented anywhere. Also, I believe the search path for include works just like import but that may not be mentioned anywhere, exactly. Also, I wouldn't be shocked if there was some pragma that could update the search path in Nim code, but I don't know of one specifically. You could also try to just email miran as he's been doing a lot of doc updating.

c-blake commented 5 years ago

Oh, and https://nim-lang.org/docs/nimc.html#compiler-usage-search-path-handling is a bona fide link you can just click if that helps.

pb-cdunn commented 5 years ago

Oh! In the compiler manual. Of course! Thanks.

c-blake commented 5 years ago

You're welcome. There really should be at least a pointer to that section of the compiler manual from the language manual somewhere around "Collective imports". That is also talking about subdir structure of to-be-imported stuff.