From: Kent L. <ke...@br...> - 2013-02-25 21:39:27
|
Thanks David. > > An alternative is to adapt your list as follows: > > --select expr select matching source names > --start expr set starting point for reading (expr = pktid or time) The main problem was actually not with the '{pktid|time}' argument, it was with the multi-letter options preceded by only a single hyphen. Were I to double the hyphen so those options conform to POSIX usage, as you suggest, the option_list parsing would recognize them properly as options, however they would then no longer match the multi-million line code-base I'm documenting. > My first reaction is to answer "mu" -- unask the question. Rethink the > problem, maybe use the workaround above. Why do you want to exactly > reproduce a construct without using that construct? First of all I like the looks of it, it's compact and elegant; second I'd like to use the option_list auto-parsing for most of the code base, most of which has POSIX-compliant options. That would mean I would have to hand-construct just a few option tables for the non-POSIX options, however I'd like them to match the style of everything else. > Seems like you'd > be going to a lot of effort for little return. Well, I was hoping it would be easy. > You could use a table without inline literals, but inline markup: > > .. class:: my-option-list > > ================= ====================================================== > \--select *expr* select matching source names > \--start *expr* set starting point for reading (expr = pktid or time) > ================= ====================================================== > > The backslashes prevent the options from being parsed as option lists. > You'd have to figure out the "my-option-list" style to apply. I'm > pretty sure it can be done, but I'd have to look it up. I guess that was the point of my question, though perhaps as a restructured-text newbie I didn't pose it well. How do I figure out, cast, and invoke the "my-option-list" style to match the installed default? Web-surfing and docutils source-code diving haven't yet proven fruitful for me. I'm not sure where to look. If this is truly a big challenge I may indeed have to punt and do something approximate as you suggest. Clearly the docutils package knows somewhere how to format option_list output tables, so I was hoping it wouldn't be too much of a treasure hunt to reproduce its recipe for that. Clues welcome -- Thanks, Kent |