Simplify GetOptions() code
This commit is contained in:
parent
ca49579fa1
commit
ba3c052c1f
1 changed files with 3 additions and 9 deletions
12
stow.in
12
stow.in
|
@ -170,15 +170,9 @@ sub process_options {
|
||||||
|
|
||||||
Getopt::Long::config('no_ignore_case', 'bundling', 'permute');
|
Getopt::Long::config('no_ignore_case', 'bundling', 'permute');
|
||||||
GetOptions(
|
GetOptions(
|
||||||
'v' => sub { $Option{'verbose'}++ },
|
\%Option,
|
||||||
'verbose:i' => sub { $Option{'verbose'}+= $_[1] || 1 },
|
'verbose|v:+', 'help|h', 'simulate|n|no', 'conflicts|c',
|
||||||
'h|help' => sub { $Option{'help'} = '1' },
|
'version|V', 'compat|p', 'dir|d=s', 'target|t=s',
|
||||||
'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] },
|
|
||||||
|
|
||||||
# clean and pre-compile any regex's at parse time
|
# clean and pre-compile any regex's at parse time
|
||||||
'ignore=s' =>
|
'ignore=s' =>
|
||||||
|
|
Loading…
Reference in a new issue