📄 ch14.024_best_ex14.5
字号:
################################################################################ Example 14.5 (Recommended) from Chapter 14 of "Perl Best Practices" #### Copyright (c) O'Reilly & Associates, 2005. All Rights Reserved. #### See: http://www.oreilly.com/pub/a/oreilly/ask_tim/2001/codepolicy.html ################################################################################# Example 14-5. Command-line parsing via Getopt::Euclid# Standard modules...use strict;use warnings;use IO::Prompt;use Carp;use English qw( -no_match_vars );use Data::Alias;use Readonly;# Handle command-lines of the form:## > orchestrate -in source.txt -o=dest.orc --verbose# Create a command-line parser that implements the documentation below...use Getopt::Euclid;# Report intended behaviour...if ($ARGV{-v}) { print "Loading first $ARGV{-l} chunks of file: $ARGV{-i}\n"}# etc.__END__=head1 NAMEorchestrate - Convert a file to Melkor's .orc format=head1 VERSIONThis documentation refers to orchestrate version 1.9.4=head1 USAGE orchestrate -in source.txt -out dest.orc [options]=head1 OPTIONS=over=item -i[n] [=] <file> Specify input file=for Euclid: file.type: readable file.default: '-'=item -o[ut] [=] <file> Specify output file=for Euclid: file.type: writable file.default: '-'=item -l[en] [=] <l>Display length (default is 24 lines)=for Euclid: l.type: integer > 0 l.default: 24=item -w[id] [=] <w>Display width (default is 78 columns)=for Euclid: w.type: integer > 0 w.default: 78=item -v=item --verbosePrint all warnings=item --version=item --usage=item --help=item --manPrint the usual program information=back=begin remainder of documentation here...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -