Simplify GetOptions() code

This commit is contained in:
Adam Spiers 2011-11-17 14:12:12 +00:00
parent ca49579fa1
commit ba3c052c1f

12
stow.in
View file

@ -170,15 +170,9 @@ sub process_options {
Getopt::Long::config('no_ignore_case', 'bundling', 'permute');
GetOptions(
'v' => sub { $Option{'verbose'}++ },
'verbose:i' => sub { $Option{'verbose'}+= $_[1] || 1 },
'h|help' => sub { $Option{'help'} = '1' },
'n|no|simulate' => sub { $Option{'simulate'} = '1' },
'c|conflicts' => sub { $Option{'conflicts'} = '1' },
'V|version' => sub { $Option{'version'} = '1' },
'p|compat' => sub { $Option{'compat'} = '1' },
'd|dir=s' => sub { $Option{'dir'} = $_[1] },
't|target=s' => sub { $Option{'target'} = $_[1] },
\%Option,
'verbose|v:+', 'help|h', 'simulate|n|no', 'conflicts|c',
'version|V', 'compat|p', 'dir|d=s', 'target|t=s',
# clean and pre-compile any regex's at parse time
'ignore=s' =>