From cc959d3a5c6e2670fd6d17267968106f5ffcd8ec Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 9 Apr 2024 23:37:02 -0400 Subject: soxdial: with --verbose, warn if dial string starts with dash(es) and a letter. --- soxdial | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/soxdial b/soxdial index 880680a..9b6527e 100755 --- a/soxdial +++ b/soxdial @@ -222,11 +222,12 @@ expected, or at all). Because the final B command reads only raw audio, it's impossible to change the bitrate or sample size in between dial strings. -B<2.> If anything on the command line starts with B<-> but isn't a -recognized option, it's not an error: it gets treated as a dial -string. This allows e.g. I<555 -1212> to work correctly, but +B<2.> If anything on the command line starts with B<-> but isn't +a recognized option, it's not an error: it gets treated as a +dial string. This allows e.g. I<555 -1212> to work correctly, but mistyped options will result in them being dialled as alphabetic characters. This may be a bit surprising the first time it happens. +If you use B<-v>, B<--verbose>, you'll get warned about it at least. B<3.> I haven't been able to test this with a real land-line phone to see whether it will actually dial out. @@ -570,6 +571,9 @@ for ($argc = 0; $argc < @ARGV; $argc++) { $digittime /= 2; $pausetime /= 2; } else { + if($verbose && (/^--?[a-z]/i)) { + warn "$SELF: treating '$_' as a dial string (might be a typo?)\n"; + } warn "$SELF: start dial string '$_'\n" if $verbose; for (split "", $_) { my $digit = uc $_; -- cgit v1.2.3