Changed optionparser to allow for default: no to be false and run update-modules #PT-2457

This commit is contained in:
Marek Knappe
2025-06-25 10:55:24 +10:00
committed by Marek Knappe
parent d0d046122b
commit 6c9ed6ed5b
25 changed files with 75 additions and 25 deletions

View File

@@ -839,7 +839,9 @@ sub _parse_specs {
$opt->{spec} =~ s/=./=s/ if ( $type && $type =~ m/[HhAadzm]/ );
if ( (my ($def) = $opt->{desc} =~ m/default\b(?: ([^)]+))?/) ) {
$self->{defaults}->{$long} = defined $def ? $def : 1;
$def = defined $def ? $def : 1;
$def = $def eq 'yes' ? 1 : $def eq 'no' ? 0 : $def;
$self->{defaults}->{$long} = $def;
PTDEBUG && _d($long, 'default:', $def);
}