]> git.decadent.org.uk Git - dak.git/blobdiff - rhona
fix rejection logic error
[dak.git] / rhona
diff --git a/rhona b/rhona
index ba99cf4f48a301600c8f17ae5b97cc5efee0b613..8446c0191ffc0f295763f3e85fb687c15a15604a 100755 (executable)
--- a/rhona
+++ b/rhona
@@ -2,7 +2,7 @@
 
 # rhona, cleans up unassociated binary and source packages
 # Copyright (C) 2000  James Troup <james@nocrew.org>
-# $Id: rhona,v 1.4 2000-12-18 07:11:25 troup Exp $
+# $Id: rhona,v 1.5 2000-12-19 21:06:20 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
@@ -42,6 +42,16 @@ overrides = {};
 
 ###################################################################################################
 
+def usage (exit_code):
+    print """Usage: rhona [OPTION]... [CHANGES]...
+  -D, --debug=VALUE         debug
+  -n, --no-action           don't do anything
+  -v, --verbose             be verbose
+  -V, --version             display version number and exit"""
+    sys.exit(exit_code)
+
+###################################################################################################
+
 # See if a given package is in the override file.  Caches and only loads override files on demand.
 
 def in_override_p (package):
@@ -315,6 +325,20 @@ def main():
     Cnf = apt_pkg.newConfiguration();
     apt_pkg.ReadConfigFileISC(Cnf,utils.which_conf_file());
 
+    Arguments = [('D',"debug","Rhona::Options::Debug", "IntVal"),
+                 ('h',"help","Rhona::Options::Help"),
+                 ('n',"no-action","Rhona::Options::No-Action"),
+                 ('v',"verbose","Rhona::Options::Verbose"),
+                 ('V',"version","Rhona::Options::Version")];
+    
+    apt_pkg.ParseCommandLine(Cnf,Arguments,sys.argv);
+    if Cnf["Rhona::Options::Help"]:
+        usage(0);
+        
+    if Cnf["Rhona::Options::Version"]:
+        print "rhona version 0.0000000000";
+        usage(0);
+
     delete_date = time.strftime("%Y-%m-%d %H:%M", time.localtime(time.time()));
 
     check_binaries();