X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=charisma;h=63d9a918e29db617edaa54e6840ac69f08c82fe4;hb=c1c7681bf43c58dd5cf34d1c1814a75ae594688b;hp=2e801dc743d6b666710bc8e7ee571cf30a3b016e;hpb=ef864c51e3eab9518c58c946b31346e598d91bb1;p=dak.git diff --git a/charisma b/charisma index 2e801dc7..63d9a918 100755 --- a/charisma +++ b/charisma @@ -2,7 +2,7 @@ # Generate Maintainers file used by e.g. the Debian Bug Tracking System # Copyright (C) 2000, 2001 James Troup -# $Id: charisma,v 1.10 2001-09-26 03:47:15 troup Exp $ +# $Id: charisma,v 1.11 2001-09-27 01:23:41 troup Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,9 +39,12 @@ packages = {} fixed_maintainer_cache = {} ################################################################################ -def usage (exit_code): + +def usage (exit_code=0): print """Usage: charisma [OPTION] EXTRA_FILE[...] Generate an index of packages <=> Maintainers. + + -h, --help show this help and exit """ sys.exit(exit_code) @@ -78,9 +81,14 @@ def main(): Cnf = apt_pkg.newConfiguration(); apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file()); - extra_files = apt_pkg.ParseCommandLine(Cnf,[],sys.argv); + Arguments = [('h',"help","Charisma::Options::Help")]; + Cnf["Charisma::Options::Help"] = ""; + extra_files = apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv); + Options = Cnf.SubTree("Charisma::Options"); + + if Options["Help"]: + usage(); - #projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"]), None, None, Cnf["DB::ROUser"]); projectB = pg.connect(Cnf["DB::Name"], Cnf["DB::Host"], int(Cnf["DB::Port"])); db_access.init(Cnf, projectB);