aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-09 23:37:02 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-11 16:52:48 -0400
commit8fe683db36032cd5bc70cef7d6e00af3ac7e55c8 (patch)
treed2ee50b1f9eac3bbab95d640aaab825bbbb2420a
parent73dfd72ca0f8e7c2be5367a38fd9bdbd8f6e6e79 (diff)
downloadsoxdial-8fe683db36032cd5bc70cef7d6e00af3ac7e55c8.tar.gz
soxdial: with --verbose, warn if dial string starts with dash(es) and a letter.
-rwxr-xr-xsoxdial10
1 files 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<sox> 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 $_;