added -f option to update command

This commit is contained in:
Yuta
2011-04-17 10:48:26 +09:00
parent 3a220f342a
commit c8779d0322
+10 -3
View File
@@ -11,7 +11,7 @@ from pythonbrew.util import rm_r, unpack_downloadfile, Link, is_gzip, Subprocess
class UpdateCommand(Command):
name = "update"
usage = "%prog"
summary = "Update pythonbrew to the latest version"
summary = "Update the pythonbrew to the latest version"
def __init__(self):
super(UpdateCommand, self).__init__()
@@ -20,7 +20,7 @@ class UpdateCommand(Command):
dest='head',
action='store_true',
default=False,
help='Update pythonbrew to the github version'
help='Update the pythonbrew to the github version'
)
self.parser.add_option(
'--config',
@@ -29,6 +29,13 @@ class UpdateCommand(Command):
default=False,
help='Update config.cfg'
)
self.parser.add_option(
'-f', '--force',
dest='force',
action='store_true',
default=False,
help='Force update the pythonbrew'
)
def run_command(self, options, args):
if options.config:
@@ -60,7 +67,7 @@ class UpdateCommand(Command):
else:
version = get_stable_version()
# check for version
if version <= VERSION:
if not options.force and version <= VERSION:
logger.info("You are already running the installed latest version of pythonbrew.")
return