Re: testing command line scripts that use optparse

2009-12-04 Thread Jean-Michel Pichavant
Peter wrote: Hi I have a script like this: def doit(input, output): parser = OptionParser() parser.add_option("-a", "--accounts", dest="accounts", default="all", help="list available accounts") ... (options, args) = parser.parse_args() # main driver if __name__ == "__mai

testing command line scripts that use optparse

2009-12-03 Thread Peter
Hi I have a script like this: def doit(input, output): parser = OptionParser() parser.add_option("-a", "--accounts", dest="accounts", default="all", help="list available accounts") ... (options, args) = parser.parse_args() # main driver if __name__ == "__main__": import