Changeset 29096 for main/trunk/greenstone2
- Timestamp:
- 2014-06-12T12:18:42+12:00 (10 years ago)
- Location:
- main/trunk/greenstone2/perllib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/buildcolutils.pm
r29079 r29096 83 83 if ($intArgLeftinAfterParsing == -1) 84 84 { 85 &PrintUsage::print_txt_usage($options, "{buildcol.params}"); 85 &PrintUsage::print_txt_usage($options, "{buildcol.params}",1); 86 print STDERR "Something went wrong during parsing the arguments. Scroll up for details.\n"; 86 87 die "\n"; 87 88 } … … 110 111 &gsprintf::output_strings_in_UTF8; 111 112 } 112 113 114 # If the user specified -h, then we output the usage 115 if (@$argv && $argv->[0] =~ /^\-+h/) { 116 &PrintUsage::print_txt_usage($options, "{buildcol.params}"); 117 die "\n"; 118 } 119 113 120 # now check that we had exactly one leftover arg, which should be 114 121 # the collection name. We don't want to do this earlier, cos 115 122 # -xml arg doesn't need a collection name 116 # Or if the user specified -h, then we output the usage also117 if ($intArgLeftinAfterParsing != 1 || (@ARGV && $ARGV[0] =~ /^\-+h/))118 {119 &PrintUsage::print_txt_usage($options, "{buildcol.params}");123 if ($intArgLeftinAfterParsing != 1) 124 { 125 &PrintUsage::print_txt_usage($options, "{buildcol.params}", 1); 126 print STDERR "There should be one argument left after parsing the script args: the collection name.\n"; 120 127 die "\n"; 121 128 } … … 163 170 if (($collection = &colcfg::use_collection($site, $collection, $collectdir)) eq "") 164 171 { 165 &PrintUsage::print_txt_usage($options, "{buildcol.params}");172 #&PrintUsage::print_txt_usage($options, "{buildcol.params}", 1); 166 173 die "\n"; 167 174 } -
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.