-Getopt::Mixed::init('a A=s c d e h i=s k L=s l m M=s o=s P=s p:s r S:i'.
- ' s t v w bigq:s body check:s debug>d diff ftr-ad ftr-ml groupwise'.
- ' help>h kminl=i kmaxl=i kdiff=i lax-security locale=s max-lines=i'.
- ' ms-smart mua>M pgp-short pgp-move pgp-move-vrf sigsmax:i spass'.
- ' version>v');
-while (my ($opt, $val, $pretty) = nextOption()) {
- if ($opt eq 'a') { $ad = 1; }
- elsif ($opt eq 'A') { $ads = $val; }
- elsif ($opt eq 'bigq') {
- if ($val !~ /^(?:(\d+)(?:,(\d+))?)?$/) { help(); }
- $bigqn = $1?$1:30;
- $bigqx = $2?$2:10;
- if ($bigqn<=0 || $bigqx<=0 || $bigqn<=$bigqx) { help(); }
- }
- elsif ($opt eq 'body') { $nohdr = 1; $hdrs = 1; }
- elsif ($opt eq 'c') { $cr = 1; }
- elsif ($opt eq 'check') {
- $check = 1;
- while ($val && $val =~ /^([^,\s]+)(?:,(\S+))?$/) {
- my $foo = $1;
- $val = $2;
-
- if ($foo =~ /^ratio(?:=(0?\.\d+))?$/) {
- $check_ratio = $1?$1:0.75;
- }
- }
+if (!Getopt::Long::GetOptions(
+ 'a' => \$ad,
+ 'A=s' => \$ads,
+ 'bigq:s' => \$_t_bigq,
+ 'body' => \$_t_nohdr,
+ 'c:i' => \$_t_cr,
+ 'check:s' => \$_t_check,
+ 'debug|d' => \$sysl,
+ 'diff' => \$diff,
+ 'e' => \$elli,
+ 'fixind' => \$fixind,
+ 'ftr-ad' => \$ftr_ad,
+ 'ftr-ml' => \$ftr_ml,
+ 'groupwise' => \$gw,
+ 'help|h' => \$_t_help,
+ 'i=s' => \$ifile,
+ 'k' => \$kamm,
+ 'kminl=i' => \$_t_kminl,
+ 'kmaxl=i' => \$_t_kmaxl,
+ 'kdiff=i' => \$_t_kdiff,
+ 'L=s' => \$footers,
+ 'l' => \$ml,
+ 'lax-security' => \$lax,
+ 'locale=s' => \$locale,
+ 'max-lines:i' => \$maxlines,
+ 'ms-smart' => \$ms_smart,
+ 'mua|M=s' => \$_t_mua,
+ 'm' => \$ms,
+ 'o=s' => \$ofile,
+ 'P=s' => \$boun,
+ 'p:s' => \$_t_redir,
+ 'pgp-short' => \$pgpshort,
+ 'pgp-move' => \$pgpmove,
+ 'pgp-move-vrf' => \$pgpmovevrf,
+ 'r' => \$hdrs,
+ 'reply' => \$reply,
+ 'S:i' => \$_t_maxsig,
+ 's' => \$sig,
+ 'sani' => \$sani,
+ 'sigsmax:i' => \$_t_sigsmax,
+ 'spass' => \$spass,
+ 't' => \$trad,
+ 'version|v' => \$_t_ver,
+ 'w' => \$trsp
+ )) {
+ help();
+}
+
+# clean up temp vals:
+if (defined $_t_bigq) {
+ if ($_t_bigq !~ /^(?:(\d+)(?:,(\d+))?)?$/) { help(); }
+ $bigqn = $1?$1:30;
+ $bigqx = $2?$2:10;
+ if ($bigqn<=0 || $bigqx<=0 || $bigqn<=$bigqx) { help(); }
+}
+if (defined $_t_help) { help(); }
+if (defined $_t_kminl) { $kminl = $_t_kminl; $kamm = 1; }
+if (defined $_t_kmaxl) { $kmaxl = $_t_kmaxl; $kamm = 1; }
+if (defined $_t_kdiff) { $kdiff = $_t_kdiff; $kamm = 1; }
+if (defined $_t_maxsig) { $lsig = $_t_maxsig ? $_t_maxsig : $maxsig; }
+if (defined $_t_mua) {
+ $mua = lc($_t_mua);
+ # mutt still displays the message when ^C'ing pgp verification:
+ if ($mua eq 'mutt' || $mua eq 'mutt-kz') {
+ $SIG{'INT'} = 'sigint_handler';