From: Matthias Andree Date: Sat, 14 Jan 2006 23:49:27 +0000 (-0000) Subject: fetchmailconf.py: Accept --help and --version. X-Git-Url: http://pileus.org/git/?a=commitdiff_plain;h=0a5d584a0f5150b48097d8dd9027e25a771f024a;p=~andy%2Ffetchmail fetchmailconf.py: Accept --help and --version. svn path=/branches/BRANCH_6-3/; revision=4636 --- diff --git a/NEWS b/NEWS index ab092f6b..c16ac65e 100644 --- a/NEWS +++ b/NEWS @@ -58,6 +58,7 @@ fetchmail 6.3.2 (to be released): * fetchmail.man: Fix accented characters in Héctor García's name. Merged from downstream debian/patches/01_man_page.dpatch. Matthias Andree. * Add missing --help text for "--sslcertck" option. Matthias Andree. +* fetchmailconf.py: Accept --help and --version. Matthias Andree. fetchmail 6.3.1 (released 2005-12-19): diff --git a/fetchmailconf.py b/fetchmailconf.py index d6c320b0..ff870233 100755 --- a/fetchmailconf.py +++ b/fetchmailconf.py @@ -5,7 +5,7 @@ # Matthias Andree # Requires Python with Tkinter, and the following OS-dependent services: # posix, posixpath, socket -version = "1.51 $Revision$" +version = "1.52 $Revision$" from Tkinter import * from Dialog import * @@ -2035,24 +2035,31 @@ gUSiYASJpMEHhilJTEnhAlGoQqYAZQ1AiqEMZ0jDGtqQImhwwA13yMMevoQAGvGhEAWHGMOAAAA7 # # Process options - (options, arguments) = getopt.getopt(sys.argv[1:], "df:hV") + (options, arguments) = getopt.getopt(sys.argv[1:], "df:hV", ["help", + "version"]) dump = rcfile = None; for (switch, val) in options: if (switch == '-d'): dump = TRUE elif (switch == '-f'): rcfile = val - elif (switch == '-h'): + elif (switch == '-h' or switch == '--help'): print """ -Usage: fetchmailconf {[-d] [-f fetchmailrc]|-h|-V} --d - dump configuration (for debugging) --f fmrc - read alternate fetchmailrc file --h - print this help text and quit --V - print fetchmailconf version and quit +Usage: fetchmailconf {[-d] [-f fetchmailrc]|-h|--help|-V|--version} + -d - dump configuration (for debugging) + -f fmrc - read alternate fetchmailrc file +--help, -h - print this help text and quit +--version, -V - print fetchmailconf version and quit """ sys.exit(0) - elif (switch == '-V'): + elif (switch == '-V' or switch == '--version'): print "fetchmailconf %s" % version + print """ +Copyright (C) 1997 - 2003 Eric S. Raymond +Copyright (C) 2005 - 2006 Matthias Andree +fetchmailconf comes with ABSOLUTELY NO WARRANTY. This is free software, you are +welcome to redistribute it under certain conditions. Please see the file +COPYING in the source or documentation directory for details. """ sys.exit(0) # Get client host's FQDN