aboutsummaryrefslogtreecommitdiff
path: root/soxdial
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-04-09 23:37:02 -0400
committerB. Watson <urchlay@slackware.uk>2024-04-09 23:37:02 -0400
commitcc959d3a5c6e2670fd6d17267968106f5ffcd8ec (patch)
treeaf08ce3fe2bee37fd451b64ae052667bd55a3a35 /soxdial
parent72593434fe271ad134618940f6de1552d8d74f60 (diff)
downloadmisc-scripts-cc959d3a5c6e2670fd6d17267968106f5ffcd8ec.tar.gz
soxdial: with --verbose, warn if dial string starts with dash(es) and a letter.
Diffstat (limited to 'soxdial')
-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 $_;