Skip to content

Commit

Permalink
make specifying an argument to --seriallog optional
Browse files Browse the repository at this point in the history
thanks @ianmcorvidae for telling me about the cool nargs='?' option!
  • Loading branch information
geeksville committed Jun 30, 2024
1 parent 18c2d08 commit a04b349
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
"request": "launch",
"module": "meshtastic",
"justMyCode": true,
"args": ["--debug", "--seriallog", "stdout"]
"args": ["--debug", "--seriallog"]
},
{
"name": "meshtastic test",
Expand Down
5 changes: 4 additions & 1 deletion meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,10 @@ def initParser():

group.add_argument(
"--seriallog",
help="Log device serial output to either 'stdout', 'none' or a filename to append to.",
help="Log device serial output to either 'none' or a filename to append to. Defaults to 'stdout' if no filename specified.",
nargs='?',
const="stdout",
default=None
)

group.add_argument(
Expand Down

0 comments on commit a04b349

Please sign in to comment.