Skip to content

Commit

Permalink
add metavars for a bunch of arguments for nicer docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmcorvidae committed Oct 4, 2024
1 parent 6be3969 commit 915066e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion meshtastic/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ def addSelectionArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser
"--ch-index",
help="Set the specified channel index for channel-specific commands. Channels start at 0 (0 is the PRIMARY channel).",
action="store",
metavar="INDEX",
)

return parser
Expand Down Expand Up @@ -1329,13 +1330,15 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
),
nargs=1,
action="append",
metavar="FIELD"
)

group.add_argument(
"--set",
help="Set a preferences field. Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')",
nargs=2,
action="append",
metavar=("FIELD", "VALUE"),
)

group.add_argument(
Expand Down Expand Up @@ -1370,6 +1373,7 @@ def addConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentParser:
"--set-ringtone",
help="Set the Notification Ringtone (up to 230 characters).",
action="store",
metavar="RINGTONE",
)

group.add_argument(
Expand Down Expand Up @@ -1457,13 +1461,15 @@ def addChannelConfigArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentPa
),
nargs=2,
action="append",
metavar=("FIELD", "VALUE"),
)

group.add_argument(
"--channel-fetch-attempts",
help=("Attempt to retrieve channel settings for --ch-set this many times before giving up. Default %(default)s."),
default=3,
type=int,
metavar="ATTEMPTS",
)

group.add_argument(
Expand Down Expand Up @@ -1572,14 +1578,16 @@ def addRemoteActionArgs(parser: argparse.ArgumentParser) -> argparse.ArgumentPar
group.add_argument(
"--sendtext",
help="Send a text message. Can specify a destination '--dest' and/or channel index '--ch-index'.",
metavar="TEXT",
)

group.add_argument(
"--traceroute",
help="Traceroute from connected node to a destination. "
"You need pass the destination ID as argument, like "
"this: '--traceroute !ba4bf9d0' "
"Only nodes that have the encryption key can be traced.",
"Only nodes with a shared channel can be traced.",
metavar="!xxxxxxxx",
)

group.add_argument(
Expand Down

0 comments on commit 915066e

Please sign in to comment.