#18 Merged
Repository
pmcnr pmcnr
Branch
default
Repository
tarek tarek
Branch
default

'optparse' based command line options for 'distribute_setup.py' when invoked as script

Author
  1. Pedro Romano avatarPedro Romano
Reviewers
Description

I would like to bootstrap a virtual environment from a local web server. Not being able to specify an alternative 'download_base' from the command line for 'distribute_setup.py' when invoked as script makes this harder.

I changed the command line options handling to use 'optparse' which should be supported from Python 2.3 to 3.3 although deprecated having been in favour of 'argparse' from Python 2.7 onwards.

A new command line option '--download-base' was added that allows specifying an alternative base download URL for the distribute package from the command line when invoking 'distribute_setup.py' as a script.

Comments (2)

  1. Erik Bray

    One thing I might change about this is keep the argv argument in main(), and pass the argv to parser.parse_args(). Not that it's likely to be an issue here, but I always use this pattern since it can be useful for testing (you can test main() without having to mess with sys.argv).

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.