[issue9399] Provide a 'print' action for argparse

2010-12-22 Thread Dennis Malcorps
Dennis Malcorps added the comment: I totally forgot about this patch, sorry... Due to university and another python project I am working on I didn't find the time to look at the test suite. I would really appreciate it if someone else could do this ;-) Anyway, I added the changes propos

[issue9399] Provide a 'print' action for argparse

2010-07-30 Thread Dennis Malcorps
Dennis Malcorps added the comment: Here is a patch that adds a 'write' action to argparse. Usage example: >>> parser = argparse.ArgumentParser() >>> parser.add_argument("--license", action="write", message="This file\nis >>> lic

[issue9399] Provide a 'print' action for argparse

2010-07-29 Thread Dennis Malcorps
Dennis Malcorps added the comment: > parser.add_argument('--license', action='write', message='...', > file=sys.stdout) The ability to redirect the output would be a nice addition. > parser.add_argument('--license', action='call'

[issue9399] Provide a 'print' action for argparse

2010-07-28 Thread Dennis Malcorps
New submission from Dennis Malcorps : Currently argparse has a 'version' action which can be triggered by user defined options which prints out a custom string. parser.add_argument("--version", action="version", version="test 1.2.3") Since the 've