6 ms·
I wrote a very sophisticated iptables command line argument parser a while back and found shlex to be too limited. Instead I used Pythons OptionParser module--
by riskable 13y ago
I wrote a very sophisticated iptables command line argument parser a while back and found shlex to be too limited. Instead I used Pythons OptionParser module--in reverse! It worked out great:
http://sourceforge.net/apps/trac/pyci/browser/iptables.py http://sourceforge.net/apps/trac/pyci/browser/iptables.py
The mechanism used by that code may or may not be helpful for you but feel free to email me (daniel.mcdougall at liftoff software dot com) if you want to collaborate. I'd love to put together a module that anyone can import to interpret/explain commands that can perform man page lookups and whatnot.