Changeset 29096 for main/trunk/greenstone2/perllib/inexport.pm
- Timestamp:
- 2014-06-12T12:18:42+12:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/inexport.pm
r29013 r29096 195 195 if ($intArgLeftinAfterParsing == -1) 196 196 { 197 &PrintUsage::print_txt_usage($options, "{import.params}"); 197 &PrintUsage::print_txt_usage($options, "{import.params}",1); 198 print STDERR "Something went wrong during parsing the arguments. Scroll up for details.\n"; 198 199 die "\n"; 199 200 } 200 201 201 202 my $language = $self->{'language'}; 202 203 # If $language has been specified, load the appropriate resource bundle … … 217 218 } 218 219 219 220 220 if ($self->{'xml'}) { 221 221 &PrintUsage::print_xml_usage($options); … … 227 227 &gsprintf::output_strings_in_UTF8; 228 228 } 229 229 230 # If the user specified -h, then we output the usage 231 if (@$argv && $argv->[0] =~ /^\-+h/) { 232 &PrintUsage::print_txt_usage($options, "{import.params}"); 233 die "\n"; 234 } 230 235 # now check that we had exactly one leftover arg, which should be 231 236 # the collection name. We don't want to do this earlier, cos 232 237 # -xml arg doesn't need a collection name 233 # Or if the user specified -h, then we output the usage also 234 235 if ($intArgLeftinAfterParsing != 1 || (@$argv && $argv->[0] =~ /^\-+h/)) 238 239 if ($intArgLeftinAfterParsing != 1 ) 236 240 { 237 ## TODO if we had invalid arg, can we signal that to user???238 &PrintUsage::print_txt_usage($options, "{import.params}");241 &PrintUsage::print_txt_usage($options, "{import.params}", 1); 242 print STDERR "There should be one argument left after parsing the script args: the collection name.\n"; 239 243 die "\n"; 240 244 } … … 306 310 307 311 if (($collection = &colcfg::use_collection($site, $collection, $collectdir)) eq "") { 308 &PrintUsage::print_txt_usage($options, "{import.params}");312 #&PrintUsage::print_txt_usage($options, "{import.params}", 1); 309 313 die "\n"; 310 314 } … … 1384 1388 $doc_source_file = &util::placeholders_to_abspath($doc_source_file); 1385 1389 1386 if (!& util::filename_is_absolute($doc_source_file)) {1390 if (!&FileUtils::isFilenameAbsolute($doc_source_file)) { 1387 1391 $doc_source_file = &FileUtils::filenameConcatenate($ENV{'GSDLCOLLECTDIR'},$doc_source_file); 1388 1392 }
Note:
See TracChangeset
for help on using the changeset viewer.