- unless (
- GetOptions(
- 'directory=s' => \$context->{directory},
- 'webgen_base=s' => \$context->{webgen_base},
- 'tar=s' => \$context->{tar_cmd},
- 'make=s' => \$context->{make_cmd},
- 'lzip!' => \$context->{compressors}{lzip},
- 'verbose!' => \$verbose,
- 'debug!' => \$debug,
- 'help|?' => \$help,
- 'man!' => \$man,
- 'delete!' => \$delete,
- 'cleanup!' => \$cleanup,
- 'build-docs!' => \$context->{build_docs},
- 'web!' => \$context->{web},
- )
- )
- {
- pod2usage( -exitval => 1, -verbose => 0 );
- }
- pod2usage(0) if $help;
- pod2usage( -verbose => 2 ) if $man;
+ GetOptions(
+ 'directory=s' => \$context->{directory},
+ 'webgen_base=s' => \$context->{webgen_base},
+ 'tar=s' => \$context->{tar_cmd},
+ 'make=s' => \$context->{make_cmd},
+ 'lzip!' => \$context->{compressors}{lzip},
+ 'verbose!' => \$verbose,
+ 'debug!' => \$debug,
+ 'help|?' => sub { pod2usage(-verbose => 1, -exit => 0) },
+ 'man!' => sub { pod2usage(-verbose => 2, -exit => 0, -noperldoc => system('perldoc -V >/dev/null 2>&1')) },
+ 'delete!' => \$delete,
+ 'cleanup!' => \$cleanup,
+ 'build-docs!' => \$context->{build_docs},
+ 'web!' => \$context->{web},
+ ) and @ARGV == 1 or pod2usage;