You are not logged in.
Hey guys,
I've been tossing around this idea for option parsing since attending pycon and finally got around to implementing it. Its the first time I've had a lot of fun coding in a while.
What it does is allow you to create command-line option parsing based on the function signature and docstring of a main method. I could describe it all here, but instead I refer you to the readme and a blog post I wrote:
http://archlinux.me/dusty/2009/05/20/in … opterator/
http://github.com/buchuki/opterator/tree/master
actually here's one example, for those of you like me who think clicking links is work:
from opterator import opterate
@opterate
def main(filename1, filename2, recursive=False, backup=False,
suffix='~', *other_filenames):
'''An example copy script with some example parameters that might
be used in a copy command.
@param recursive store_true -r --recursive copy directories
recursively
@param backup store_true -b --backup backup any files you copy over
@param suffix store -S --suffix override the usual backup
suffix '''
# implementation here
Now you saw the example, so you probably want to see how the output looks and how the help text looks for that... now you're going to click the link.
Dusty
Offline
I had a similar idea a while ago, I have a simple (very crappy) implementation around - I never actually did anything with it, but here it is: http://pastebin.com/f732ff51f
Offline
Nice idea.
Offline