From ba3c052c1fc6f67d4ad7a9667bdb1ad5011af6ae Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 17 Nov 2011 14:12:12 +0000 Subject: [PATCH] Simplify GetOptions() code --- stow.in | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/stow.in b/stow.in index df66830..e9c25ec 100755 --- a/stow.in +++ b/stow.in @@ -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' =>