RFE: port command line parsing to something sane

Bug #79215 reported by Daniel Holbach on 2007-01-14
6
Affects Status Importance Assigned to Milestone
Bug Helper
Medium
Unassigned

Bug Description

The command line parsing in ./bugHelper/commandLine.py is pretty naïve at the moment. We need to port it to something sane to make the code maintainable.

Things we can investigate:
 - native python support for doing that
 - glib python bindings (think GOption in C)
 - something else.

Changed in bughelper:
importance: Undecided → Medium
Changed in bughelper:
status: Unconfirmed → Confirmed
Diogo Matsubara (matsubara) wrote :

Hello Daniel,

we use optparse for some scripts in Launchpad and it works really well.

http://docs.python.org/lib/module-optparse.html

Hope that helps.

Fernando Ribeiro (ipsec) wrote :

I'm rewriting to use optparse now.

Fernando Ribeiro (ipsec) wrote :

First patch using optparse.

Can somebody to test it?
It have new options (use --help for verbose).

Fernando Ribeiro (ipsec) wrote :

new patch without binary and backup =)

Daniel Holbach (dholbach) wrote :

Thanks a lot Fernando: awesome work. I committed a modified version to ~dholbach/bughelper/bughelper.dev - please everybody test and check.

Some minor nitpicks:
 - please use an indentation level of 4 spaces (PEP-8 wants that too and we use it throughout)
 - please makes lines only max. 79 chars long
 - I added your name to the contributors list instead of adding it to the header file and also mentioned you in the commit log - I hope that's ok for you
 - and also changed the variable names in a few places to make it more consistent

One change I committed with this change is Sébastien's request to drop the '-a' option. We do '--all' pages by default now.

(The command line options changed in a few places as well - please take care of that in the documentation - Alex Muntada?)

Thanks again Fernando - nice work.

Changed in bughelper:
status: Confirmed → Fix Committed
Dean Sas (dsas) wrote :

Reviewed and merged, thanks again Fernando and dholbach

Changed in bughelper:
status: Fix Committed → Fix Released
Alex Muntada (alex.muntada) wrote :

Man pages in ~alex.muntada/bughelper/bughelper.dev are up to date with Fernando's changes. The README and wiki pages aren't yet, but that's part of bug 79222.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers