Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hindess <soft-github@temporalanomaly.com>2012-05-20 20:01:40 +0400
committerMark Hindess <soft-github@temporalanomaly.com>2012-05-20 20:01:40 +0400
commitb0303c1e3bf2176319d51c47756c1f202c53dc37 (patch)
treedfa2b2a107d7dfd0ac4c2a1607ec51adabcaa4c5 /slic3r.pl
parent67a076b360ae63d0d941faeec5b7fcd2f0461fe0 (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-xslic3r.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/slic3r.pl b/slic3r.pl
index 883cb0e68..c223aaa7e 100755
--- a/slic3r.pl
+++ b/slic3r.pl
@@ -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);