[PQM/MERGE] Convert PQM to use optparse
John Arbash Meinel
john at arbash-meinel.com
Tue Jul 8 17:22:48 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel Watkins wrote:
| Currently, PQM is using getopt for its command line option parsing.
| This works, but requires a manual sync between option parsing and help
| messages, and is just generally a pain. Attached is a patch which
| converts from getopt to an optparse.OptionParser.
|
|
/me is a big fan of optparse over getopt. I am John Meinel, and I
endorse this change. :)
I would mention that I really dislike top-level code. I personally
recommend the style of:
def main(args?):
~ do stuff as a main function
if __name__ == '__main__':
~ sys.exit(main(sys.argv[1:]?))
I don't know if that is possible with how pqm is layered, etc. I just
find it nicer to work with.
John
=:->
PS> Mostly trying to clear out my mail and make sure things have responses.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkhzlFgACgkQJdeBCYSNAAMN6QCgsvnSnfHtejbiP3UB94S90LaV
K74AoKMYOSuxCcw3Fn+BIKpWck4IbqEF
=1RAp
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list