【发布时间】:2020-02-07 20:03:00
【问题描述】:
Getopt::Long::Configure("no_pass_through");
my %opts = ();
GetOptions(\%opts,
'opt1=s',
'opt2=s',
'opt3'
);
test.pl bad_option_without_dash
当错误的选项不带破折号传递时,如何让 getopts 标记错误?我期待no_pass_through 会处理这个问题。我错过了什么?
【问题讨论】:
-
查看Getopt::Long 文档,注意描述部分的第一段——你会发现你缺少什么。
标签: perl getopt getopt-long