mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-31 12:41:20 -06:00 
			
		
		
		
	Merge pull request #378 from beanz/underscore-options
Allow cli options to use '_' instead of '-'.
This commit is contained in:
		
						commit
						0a5cf4ba90
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		|  | @ -30,8 +30,12 @@ my %cli_options = (); | ||||||
|     ); |     ); | ||||||
|     foreach my $opt_key (keys %$Slic3r::Config::Options) { |     foreach my $opt_key (keys %$Slic3r::Config::Options) { | ||||||
|         my $opt = $Slic3r::Config::Options->{$opt_key}; |         my $opt = $Slic3r::Config::Options->{$opt_key}; | ||||||
|         $options{ $opt->{cli} } = \$cli_options{$opt_key} |         my $cli = $opt->{cli} or next; | ||||||
|             if $opt->{cli}; |         if ($cli =~ /-/) { | ||||||
|  |             # allow alternative options with '_' in place of '-' | ||||||
|  |             $cli = $opt_key.'|'.$cli; | ||||||
|  |         } | ||||||
|  |         $options{ $cli } = \$cli_options{$opt_key}; | ||||||
|     } |     } | ||||||
|      |      | ||||||
|     GetOptions(%options) or usage(1); |     GetOptions(%options) or usage(1); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alessandro Ranellucci
						Alessandro Ranellucci