mansnip icon indicating copy to clipboard operation
mansnip copied to clipboard

Find -z conditional expression in bash manpage

Open pylipp opened this issue 4 years ago • 10 comments

Thanks for the great tool, just started experimenting a little bit :) How come mansnip does not find the part about -z string in the CONDITIONAL EXPRESSIONS section? I tried mansnip bash '-z string'.

pylipp avatar Apr 24 '20 21:04 pylipp

hrmm ... this is why I need some regression testing. I can fix it but I can't see what it may break. Let me do that.

kristopolous avatar Apr 26 '20 01:04 kristopolous

alright I added a testing system and hopefully addressed this issue

kristopolous avatar Apr 26 '20 04:04 kristopolous

Thanks, that fixes the issue for me :) I also wondered why mansnip bash CONDITIONAL does not return anything...

pylipp avatar Apr 26 '20 08:04 pylipp

lol ok let me look into that. This is why this hasn't been done before. It's actually not easy.

kristopolous avatar Apr 26 '20 22:04 kristopolous

so you're looking for a subheading jump? I never really planned for those but it's probably possible.

kristopolous avatar Apr 27 '20 00:04 kristopolous

Alright, this now works with the caveat of sometimes showing a line or two of extra information ... that can also be avoided but the only solution I can currently think of is rather sophisticated.

kristopolous avatar Apr 27 '20 00:04 kristopolous

ug, not even my hypothesized sophisticated method would work ... I'd have to parse the source man file

kristopolous avatar Apr 27 '20 00:04 kristopolous

alright, I'll bump the pypi version with this fix and then contemplate my destiny.

kristopolous avatar Apr 27 '20 00:04 kristopolous

I'm definitely in an avoidance/procrastination pattern now. What a toxic mess those are ... let me do something

kristopolous avatar Apr 28 '20 16:04 kristopolous

So I could re-interpret the groff man files and then basically create my own post-processor to format it. I forget language theory from university but this is essentially a regular grammar with a simple stack machine. what a shitton of work though.

kristopolous avatar Apr 28 '20 16:04 kristopolous