Convert to use OptionParser for command line handling.

Move the command line option handling from the more manual "getopts"
module to the full fledged "OptionParser". It has the advantage of
e.g. automatically creating the Help text that is shown with the
"-h/--help" option rather than having to hardcode the text and
format the line breaking manually.

Also, do away with the version check when invoking OfflineImap so we
do not have to change the version number in three places when bumping
it.

Rename startup() to run() which sounds more in line what other modules
call their run functions (e.g. Thread.run()).

Signed-Off-By: Sebastian Spaeth <Sebastian@SSpaeth.de>

Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Sebastian Spaeth
2010-12-15 12:06:59 -06:00
committed by Nicolas Sebrecht
parent 1c106a4ce9
commit 85e8aea94f
4 changed files with 168 additions and 166 deletions

View File

@ -19,5 +19,5 @@
from offlineimap import OfflineImap
offlineimap = OfflineImap()
offlineimap.startup('6.3.1')
oi = OfflineImap()
oi.run()