Changeset 39506
- Timestamp:
- Mar 31, 2016, 6:36:52 AM (10 years ago)
- File:
-
- 1 edited
-
trunk/Nebulous/bin/neb-repair (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Nebulous/bin/neb-repair
r32554 r39506 32 32 33 33 pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV; 34 pod2usage( -msg => "Required options: --server", -exitval => 2 ) 35 unless $server; 36 pod2usage( -msg => "missing key", exitval => 2 ) 37 unless defined $key; 34 pod2usage( -msg => "Required options: --server", -exitval => 2 ) unless $server; 35 pod2usage( -msg => "missing key", exitval => 2 ) unless defined $key; 36 37 # this program should exit (with success status) if file is not a neb file 38 39 my $scheme = file_scheme ($key); 40 if ($scheme eq "file") { print "key is a file, not a nebulous key\n"; exit 0; } 41 if ($scheme eq "path") { print "key is a path, not a nebulous key\n"; exit 0; } 38 42 39 43 my $neb = Nebulous::Client->new( … … 158 162 # } 159 163 160 164 # Return the scheme used for a filename (copied from PS-IPP-Config/lib/PS/IPP/Config.pm 165 sub file_scheme 166 { 167 my $name = shift; # Filename for which to get the scheme 168 my ($scheme) = $name =~ /^(path|neb|file):/; # The scheme, e.g., file://, path:// 169 if undef $scheme { $scheme = "none"; } 170 # $scheme may be undef if the input doesn't contain one of the above recognised schemes 171 unless (defined($scheme)) { $scheme = "none"; } 172 return $scheme; 173 } 161 174 162 175 __END__
Note:
See TracChangeset
for help on using the changeset viewer.
