Closed halloleo closed 3 years ago
render
is really a "mid processor" (not post or pre..closer to pre). It is more for things like ANSI SGR highlighting. There the rendered size in text columns can be much smaller than the number of bytes which can really impact wrapping (with render(s).printedLen much less than s.len you can wrap much later). So, word wrapping happens after.
It applies both to help
columns for params and to (inferred or passed) doc
comment text. It may not impact help
if you did not pass any since cligen
cannot infer help
.
It looks like what you really want is test/HelpTabCols.nim
, though. So, I am closing this issue. There really are a lot of features, only weakly documented outside the code itself or issues that people have raised. So, you should probably get used to (as the README says) look at test/
or search the github issues.
Thanks for the tip with test/HelpTabCols.nim
! Will have a look. And you are right I should read the tests in detail...
That's exactly what I needed: clCfg.hTabCols = @[ clOptKeys, clDflVal, clDescrip]
Thanks again!
Sure thing.
I tried to name the test/demo programs descriptively, but that competes with "short names". Also, because it takes almost 5 seconds to run all 60 of them (with cc=tcc
in my nim.cfg
) I have occasionally "cheated" and used one program for >1 purpose. :-)
Someone (you, maybe?) should write up 60..90 line "index" on the wiki of "how to do X: see test/Y". Of course people who don't read test/
may also not read the wiki (or search back GH issues) but that wiki page may make it more "automatically searchable".
Again an issue from me! So I guess the first thing I really should mention is that I very much like cligen. It's a great piece of library!
Anyway, I tried a custom render proc for the help output in a
dispatchMulti
CLI, but even in a simple form:the result is rather a surprise to me: It seems to only affect the doc string! Do I do something wrong?
ps: I went down the custom render path, because I am trying to eliminate the argument type column from the help output, but I guess, a custom render is not the way to go...
pps: I am using the HEAD version of cligen.