Ignore:
Timestamp:
2017-08-24T12:34:30+12:00 (7 years ago)
Author:
kjdon
Message:

small tidy up to parsing. remove - if there, but allow the arg to not have -. Don't put the - back on to the extra arg as it will probably be the collection name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/parse2.pm

    r28700 r31919  
    275275        # If it is start with a "-" sign then take it off
    276276        $strOneArg =~ s/^-+//;
    277 
     277    }
    278278        # If the inputed argument is defined in the argument
    279279        # list from this plugin then process
     
    296296        if($blnAllowExtraOptions eq "true")
    297297        {
    298             push(@ExtraOption,"-$strOneArg");
     298            push(@ExtraOption,"$strOneArg");
    299299        }
    300300        else
    301301        {
    302302            print STDERR "<BadArgument a=$strOneArg>\n";
    303             print STDERR " Error: occur in parse2.pm::parse()\n Extra Arguments: $strOneArg\n";
     303            print STDERR " Error: occur in parse2.pm::parse()\n Invalid Argument: $strOneArg\n";
    304304            return -1;
    305305        }
    306306        }
    307     }
    308    
    309     # This part follow the previous parsing system.
    310     # It doesn't return error message even user
    311     # gave a invalid argument.
    312     else
    313     {
    314         if($blnAllowExtraOptions eq "true")
    315         {
    316         push(@ExtraOption,$strOneArg);
    317         }
    318         else
    319         {
    320         print STDERR " Error: occur in parse2.pm::parse()\n Invalid Argument: $strOneArg\n";
    321         return -1;
    322         }
    323     }
    324307    }
    325308
Note: See TracChangeset for help on using the changeset viewer.