diff options
author | Chris Liechti <cliechti@gmx.net> | 2015-08-30 22:16:50 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2015-08-30 22:16:50 +0200 |
commit | 9a99cb263516e30a50e27a13de0b63d2cad7dd82 (patch) | |
tree | 1fa56f097614ea7c2fc19dd48064831434287c99 /documentation/pyserial_api.rst | |
parent | 033f17c9d5c40fe8b5e55b6ada1d483b612ca092 (diff) | |
download | pyserial-git-9a99cb263516e30a50e27a13de0b63d2cad7dd82.tar.gz |
list_ports: add -n N option, doc update
Diffstat (limited to 'documentation/pyserial_api.rst')
-rw-r--r-- | documentation/pyserial_api.rst | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/documentation/pyserial_api.rst b/documentation/pyserial_api.rst index 32829dd..36293ad 100644 --- a/documentation/pyserial_api.rst +++ b/documentation/pyserial_api.rst @@ -501,7 +501,7 @@ Native ports - .. note:: The following members are deprecated nd will be removed in a + .. note:: The following members are deprecated and will be removed in a future release. .. attribute:: portstr @@ -1192,8 +1192,36 @@ serial.tools.list_ports``). It also contains the following functions. only those that match the regexp. +Command line usage + +Help for ``python -m serial.tools.list_ports``:: + + usage: list_ports.py [-h] [-v] [-q] [-n N] [regexp] + + Serial port enumeration + + positional arguments: + regexp only show ports that match this regex + + optional arguments: + -h, --help show this help message and exit + -v, --verbose show more messages + -q, --quiet suppress all messages + -n N only output the N-th entry + +Examples: + +- List all ports with details:: + + python -m serial.tools.list_ports -v + +- List the 2nd port matching a USB VID:PID pattern:: + + python -m serial.tools.list_ports 1234:5678 -q -n 2 + + serial.tools.miniterm ------------------------ +--------------------- .. module:: serial.tools.miniterm .. versionadded:: 2.6 |