summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2015-09-01 02:56:04 +0200
committerChris Liechti <cliechti@gmx.net>2015-09-01 02:56:04 +0200
commit7cf82766212c6c927a4b246a0a56c190d8f699f7 (patch)
treed8093cd3896ad4d4c1f16fecb461f96cc3443a62
parent89313c9c1e14db11beb244dbd10e16015674c729 (diff)
downloadpyserial-git-7cf82766212c6c927a4b246a0a56c190d8f699f7.tar.gz
miniterm: add '-' as value for the port for "ask the user"
without this value, it would not be possible to specify the baudrate and let the user select the port.
-rw-r--r--serial/tools/miniterm.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/serial/tools/miniterm.py b/serial/tools/miniterm.py
index 20615e3..cb24d0d 100644
--- a/serial/tools/miniterm.py
+++ b/serial/tools/miniterm.py
@@ -666,7 +666,7 @@ def main(default_port=None, default_baudrate=9600, default_rts=None, default_dtr
parser.add_argument(
"port",
nargs='?',
- help="serial port name",
+ help="serial port name ('-' to show port list)",
default=default_port)
parser.add_argument(
@@ -782,7 +782,7 @@ def main(default_port=None, default_baudrate=9600, default_rts=None, default_dtr
parser.error('--exit-char can not be the same as --menu-char')
# no port given on command line -> ask user now
- if args.port is None:
+ if args.port is None or args.port == '-':
try:
args.port = ask_for_port()
except KeyboardInterrupt: