From 46960c1b50c3937c073a65422313925f78007a2b Mon Sep 17 00:00:00 2001
From: djk <djk>
Date: Fri, 10 Mar 2000 21:52:04 +0000
Subject: [PATCH] added -c option to convkeps.pl

---
 perl/Keps.pm     |  4 ++--
 perl/convkeps.pl | 12 +++++++++---
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/perl/Keps.pm b/perl/Keps.pm
index 657793b2..04206c5a 100644
--- a/perl/Keps.pm
+++ b/perl/Keps.pm
@@ -1,7 +1,7 @@
 #
 # this file is automatically produced by convkeps.pl
 #
-# Last update: Fri Mar 10 21:40:03 2000
+# Last update: Fri Mar 10 21:50:41 2000
 #
 
 package Sun;
@@ -792,4 +792,4 @@ package Sun;
     epoch => '55.24225022'
   }
 );
-
+1;
diff --git a/perl/convkeps.pl b/perl/convkeps.pl
index 3b08e64d..65e53f40 100755
--- a/perl/convkeps.pl
+++ b/perl/convkeps.pl
@@ -27,6 +27,9 @@
 #    email | convkeps.pl        (in amsat email format)  
 #    convkeps.pl -p keps.in     (a file with just plain keps)
 # 
+# if you add the -c flag then the %keps hash will be cleared down
+# before adding the new ones.
+#
 # Copyright (c) 2000 Dirk Koopman G1TLH
 #
 # $Id$
@@ -49,7 +52,7 @@ use strict;
 use vars qw($root %keps);
 
 use Data::Dumper;
-use Keps;
+require Keps;
 
 my $fn = "$root/local/Keps.pm";
 my $state = 0;
@@ -64,13 +67,16 @@ while (@ARGV) {
 		$state = 1;
 	} elsif ($arg eq '-e') {
 		$state = 0;
+	} elsif ($arg eq '-c') {
+		%keps = ();
 	} elsif ($arg =~ /^-/) {
-		die "Usage: convkeps.pl [-e|-p] [<filename>]\n\t-p - plain file just containing keps\n\t-e - amsat email format input file (default)\n";
+		die "Usage: convkeps.pl [-c] [-e|-p] [<filename>]\n\t-p - plain file just containing keps\n\t-e - amsat email format input file (default)\n\t-c - clear Keps data before adding this lot\n";
 	} else {
 		open (IN, $arg) or die "cannot open $arg (!$)";
 		$f = \*IN;
 	}
 }
+
 while (<$f>) {
 	++$line;
 	chomp;
@@ -138,7 +144,7 @@ print OUT "#\n# this file is automatically produced by convkeps.pl\n#\n";
 print OUT "# Last update: ", scalar gmtime, "\n#\n";
 print OUT "\npackage Sun;\n\n";
 print OUT $dd->Dumpxs;
-print OUT "\n";
+print OUT "1;\n";
 close(OUT);
 
 
-- 
2.43.0