diff options
author | Mark Hindess <soft-github@temporalanomaly.com> | 2012-05-20 20:01:40 +0400 |
---|---|---|
committer | Mark Hindess <soft-github@temporalanomaly.com> | 2012-05-20 20:01:40 +0400 |
commit | b0303c1e3bf2176319d51c47756c1f202c53dc37 (patch) | |
tree | dfa2b2a107d7dfd0ac4c2a1607ec51adabcaa4c5 /slic3r.pl | |
parent | 67a076b360ae63d0d941faeec5b7fcd2f0461fe0 (diff) |
Allow cli options to use '_' instead of '-'.
This makes it easier to copy and paste options from config files.
Diffstat (limited to 'slic3r.pl')
-rwxr-xr-x | slic3r.pl | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -30,8 +30,12 @@ my %cli_options = (); ); foreach my $opt_key (keys %$Slic3r::Config::Options) { my $opt = $Slic3r::Config::Options->{$opt_key}; - $options{ $opt->{cli} } = \$cli_options{$opt_key} - if $opt->{cli}; + my $cli = $opt->{cli} or next; + if ($cli =~ /-/) { + # allow alternative options with '_' in place of '-' + $cli = $opt_key.'|'.$cli; + } + $options{ $cli } = \$cli_options{$opt_key}; } GetOptions(%options) or usage(1); |