Index: trunk/Nebulous/bin/neb-repair
===================================================================
--- trunk/Nebulous/bin/neb-repair	(revision 39505)
+++ trunk/Nebulous/bin/neb-repair	(revision 39506)
@@ -32,8 +32,12 @@
 
 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
-pod2usage( -msg => "Required options: --server", -exitval => 2 )
-    unless $server;
-pod2usage( -msg => "missing key", exitval => 2 )
-    unless defined $key;
+pod2usage( -msg => "Required options: --server", -exitval => 2 ) unless $server;
+pod2usage( -msg => "missing key", exitval => 2 ) unless defined $key;
+
+# this program should exit (with success status) if file is not a neb file
+
+my $scheme = file_scheme ($key);
+if ($scheme eq "file") { print "key is a file, not a nebulous key\n"; exit 0; }
+if ($scheme eq "path") { print "key is a path, not a nebulous key\n"; exit 0; }
 
 my $neb = Nebulous::Client->new(
@@ -158,5 +162,14 @@
 # }
 
-
+# Return the scheme used for a filename (copied from PS-IPP-Config/lib/PS/IPP/Config.pm
+sub file_scheme
+{
+    my $name = shift;                # Filename for which to get the scheme
+    my ($scheme) = $name =~ /^(path|neb|file):/; # The scheme, e.g., file://, path://
+    if undef $scheme { $scheme = "none"; }
+    # $scheme may be undef if the input doesn't contain one of the above recognised schemes
+    unless (defined($scheme)) { $scheme = "none"; }
+    return $scheme;
+}
 
 __END__
