Skip to content

Commit a04b349

Browse files
committed
make specifying an argument to --seriallog optional
thanks @ianmcorvidae for telling me about the cool nargs='?' option!
1 parent 18c2d08 commit a04b349

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@
164164
"request": "launch",
165165
"module": "meshtastic",
166166
"justMyCode": true,
167-
"args": ["--debug", "--seriallog", "stdout"]
167+
"args": ["--debug", "--seriallog"]
168168
},
169169
{
170170
"name": "meshtastic test",

meshtastic/__main__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,7 +1170,10 @@ def initParser():
11701170

11711171
group.add_argument(
11721172
"--seriallog",
1173-
help="Log device serial output to either 'stdout', 'none' or a filename to append to.",
1173+
help="Log device serial output to either 'none' or a filename to append to. Defaults to 'stdout' if no filename specified.",
1174+
nargs='?',
1175+
const="stdout",
1176+
default=None
11741177
)
11751178

11761179
group.add_argument(

0 commit comments

Comments
 (0)