Changeset 28700 for main/trunk


Ignore:
Timestamp:
2013-11-28T14:39:07+13:00 (10 years ago)
Author:
kjdon
Message:

when parsing the args, if we are setting the value based on the default, set also default_argname, so that later on we can tell the difference between a default value explicitly set by the user, or one just from the default in the arg description. This means that we cna now set all defaults in the args data structure, rather than leaving them empty and setting the default in the code.

File:
1 edited

Legend:

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

    r27303 r28700  
    361361        {
    362362        $self->{"$strArgName"} = $hashOneArg->{"deft"};
     363        $self->{"default_$strArgName"} = 1;
     364
    363365        }
    364366        else
     
    366368        if($hashOneArg->{"type"} eq "flag"){
    367369            $self->{"$strArgName"} = 0;
     370            $self->{"default_$strArgName"} = 1;
    368371        }
    369372        else {
    370373            # all other cases, use "" as default
    371374            $self->{"$strArgName"} = "";
     375            $self->{"default_$strArgName"} = 1;
    372376        }
    373377        }
Note: See TracChangeset for help on using the changeset viewer.