Skip to content

Comments

Add a number of argument groups to organize the help output#679

Merged
ianmcorvidae merged 2 commits intomeshtastic:masterfrom
ianmcorvidae:argument-groups
Oct 4, 2024
Merged

Add a number of argument groups to organize the help output#679
ianmcorvidae merged 2 commits intomeshtastic:masterfrom
ianmcorvidae:argument-groups

Conversation

@ianmcorvidae
Copy link
Contributor

Largely just rearranges, but I did also update a couple of argument descriptions, metavars, that sort of thing. The help output with these changes:

usage: meshtastic [-h | --version | --support] [--port [PORT] | --host [HOST] | --ble [BLE]] [--ble-scan] [--dest !xxxxxxxx] [--ch-index CH_INDEX]
                  [--configure CONFIGURE] [--export-config] [--get GET] [--set SET SET] [--begin-edit] [--commit-edit] [--get-canned-message]
                  [--set-canned-message SET_CANNED_MESSAGE] [--get-ringtone] [--set-ringtone SET_RINGTONE] [--ch-vlongslow] [--ch-longslow] [--ch-longfast]
                  [--ch-medslow] [--ch-medfast] [--ch-shortslow] [--ch-shortfast] [--set-owner SET_OWNER] [--set-owner-short SET_OWNER_SHORT] [--set-ham SET_HAM]
                  [--seturl SETURL] [--setalt SETALT] [--setlat SETLAT] [--setlon SETLON] [--remove-position] [--pos-fields [POS_FIELDS ...]] [--ch-add CH_ADD]
                  [--ch-del] [--ch-set CH_SET CH_SET] [--channel-fetch-attempts CHANNEL_FETCH_ATTEMPTS] [--qr] [--qr-all] [--ch-enable] [--ch-disable] [--info]
                  [--nodes] [--sendtext SENDTEXT] [--traceroute TRACEROUTE] [--request-telemetry] [--request-position] [--reply]
                  [--reboot | --reboot-ota | --enter-dfu | --shutdown | --device-metadata | --factory-reset | --factory-reset-device | --remove-node !xxxxxxxx | --reset-nodedb | --set-time [TIMESTAMP]]
                  [--seriallog [LOG_DESTINATION]] [--ack] [--timeout SECONDS] [--no-nodes] [--debug] [--test] [--wait-to-disconnect [SECONDS]] [--noproto]
                  [--listen] [--no-time] [--power-riden POWER_RIDEN | --power-ppk2-meter | --power-ppk2-supply | --power-sim] [--power-voltage POWER_VOLTAGE]
                  [--power-stress] [--power-wait] [--slog [SLOG]] [--gpio-wrb GPIO_WRB GPIO_WRB] [--gpio-rd GPIO_RD] [--gpio-watch GPIO_WATCH] [--tunnel]
                  [--subnet TUNNEL_NET]

Help:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --support             Show support info (useful when troubleshooting an issue)

Connection:
  Optional arguments that specify how to connect to a Meshtastic device.

  --port [PORT], --serial [PORT], -s [PORT]
                        The port of the device to connect to using serial, e.g. /dev/ttyUSB0. (defaults to trying to detect a port)
  --host [HOST], --tcp [HOST], -t [HOST]
                        Connect to a device using TCP, optionally passing hostname or IP address to use. (defaults to 'localhost')
  --ble [BLE], -b [BLE]
                        Connect to a BLE device, optionally specifying a device name (defaults to 'any')
  --ble-scan            Scan for Meshtastic BLE devices that may be available to connect to

Selection:
  Arguments that select channels to use, destination nodes, etc.

  --dest !xxxxxxxx      The destination node id for any sent commands, if not set '^all' or '^local' is assumed as appropriate
  --ch-index CH_INDEX   Set the specified channel index for channel-specific commands. Channels start at 0 (0 is the PRIMARY channel).

Import/Export:
  Arguments that concern importing and exporting configuration of Meshtastic devices

  --configure CONFIGURE
                        Specify a path to a yaml(.yml) file containing the desired settings for the connected device.
  --export-config       Export the configuration in yaml(.yml) format.

Configuration:
  Arguments that concern general configuration of Meshtastic devices

  --get GET             Get a preferences field. Use an invalid field such as '0' to get a list of all fields. Can use either snake_case or camelCase format.
                        (ex: 'ls_secs' or 'lsSecs')
  --set SET SET         Set a preferences field. Can use either snake_case or camelCase format. (ex: 'ls_secs' or 'lsSecs')
  --begin-edit          Tell the node to open a transaction to edit settings
  --commit-edit         Tell the node to commit open settings transaction
  --get-canned-message  Show the canned message plugin message
  --set-canned-message SET_CANNED_MESSAGE
                        Set the canned messages plugin message (up to 200 characters).
  --get-ringtone        Show the stored ringtone
  --set-ringtone SET_RINGTONE
                        Set the Notification Ringtone (up to 230 characters).
  --ch-vlongslow        Change to the very long-range and slow modem preset
  --ch-longslow         Change to the long-range and slow modem preset
  --ch-longfast         Change to the long-range and fast modem preset
  --ch-medslow          Change to the med-range and slow modem preset
  --ch-medfast          Change to the med-range and fast modem preset
  --ch-shortslow        Change to the short-range and slow modem preset
  --ch-shortfast        Change to the short-range and fast modem preset
  --set-owner SET_OWNER
                        Set device owner name
  --set-owner-short SET_OWNER_SHORT
                        Set device owner short name
  --set-ham SET_HAM     Set licensed Ham ID and turn off encryption
  --seturl SETURL       Set a channel URL

Position Configuration:
  Arguments that modify fixed position and other position-related configuration.

  --setalt SETALT       Set device altitude in meters (allows use without GPS), and enable fixed position. When providing positions with `--setlat`, `--setlon`,
                        and `--setalt`, missing values will be set to 0.
  --setlat SETLAT       Set device latitude (allows use without GPS), and enable fixed position. Accepts a decimal value or an integer premultiplied by 1e7. When
                        providing positions with `--setlat`, `--setlon`, and `--setalt`, missing values will be set to 0.
  --setlon SETLON       Set device longitude (allows use without GPS), and enable fixed position. Accepts a decimal value or an integer premultiplied by 1e7.
                        When providing positions with `--setlat`, `--setlon`, and `--setalt`, missing values will be set to 0.
  --remove-position     Clear any existing fixed position and disable fixed position.
  --pos-fields [POS_FIELDS ...]
                        Specify fields to send when sending a position. Use no argument for a list of valid values. Can pass multiple values as a space separated
                        list like this: '--pos-fields ALTITUDE HEADING SPEED'

Channel Configuration:
  Arguments that concern configuration of channels

  --ch-add CH_ADD       Add a secondary channel, you must specify a channel name
  --ch-del              Delete the ch-index channel
  --ch-set CH_SET CH_SET
                        Set a channel parameter. To see channel settings available:'--ch-set all all --ch-index 0'. Can set the 'psk' using this command. To
                        disable encryption on primary channel:'--ch-set psk none --ch-index 0'. To set encryption with a new random key on second channel:'--ch-
                        set psk random --ch-index 1'. To set encryption back to the default:'--ch-set psk default --ch-index 0'. To set encryption with your own
                        key: '--ch-set psk 0x1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b1a1a1a1a2b2b2b2b --ch-index 0'.
  --channel-fetch-attempts CHANNEL_FETCH_ATTEMPTS
                        Attempt to retrieve channel settings for --ch-set this many times before giving up. Default 3.
  --qr                  Display a QR code for the node's primary channel (or all channels with --qr-all). Also shows the shareable channel URL.
  --qr-all              Display a QR code and URL for all of the node's channels.
  --ch-enable           Enable the specified channel. Use --ch-add instead whenever possible.
  --ch-disable          Disable the specified channel Use --ch-del instead whenever possible.

Local Actions:
  Arguments that take actions or request information from the local node only.

  --info                Read and display the radio config information
  --nodes               Print Node List in a pretty formatted table

Remote Actions:
  Arguments that take actions or request information from either the local node or remote nodes via the mesh.

  --sendtext SENDTEXT   Send a text message. Can specify a destination '--dest' and/or channel index '--ch-index'.
  --traceroute TRACEROUTE
                        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.
  --request-telemetry   Request telemetry from a node. You need to pass the destination ID as argument with '--dest'. For repeaters, the nodeNum is required.
  --request-position    Request the position from a node. You need to pass the destination ID as an argument with '--dest'. For repeaters, the nodeNum is
                        required.
  --reply               Reply to received messages

Remote Admin Actions:
  Arguments that interact with local node or remote nodes via the mesh, requiring admin access.

  --reboot              Tell the destination node to reboot
  --reboot-ota          Tell the destination node to reboot into factory firmware (ESP32)
  --enter-dfu           Tell the destination node to enter DFU mode (NRF52)
  --shutdown            Tell the destination node to shutdown
  --device-metadata     Get the device metadata from the node
  --factory-reset, --factory-reset-config
                        Tell the destination node to install the default config, preserving BLE bonds & PKI keys
  --factory-reset-device
                        Tell the destination node to install the default config and clear BLE bonds & PKI keys
  --remove-node !xxxxxxxx
                        Tell the destination node to remove a specific node from its DB, by node number or ID
  --reset-nodedb        Tell the destination node to clear its list of nodes
  --set-time [TIMESTAMP]
                        Set the time to the provided unix epoch timestamp, or the system's current time if omitted or 0.

Miscellaneous arguments:
  --seriallog [LOG_DESTINATION]
                        Log device serial output to either 'none' or a filename to append to. Defaults to 'stdout' if no filename specified.
  --ack                 Use in combination with compatible actions (e.g. --sendtext) to wait for an acknowledgment.
  --timeout SECONDS     How long to wait for replies. Default 300s.
  --no-nodes            Request that the node not send node info to the client. Will break things that depend on the nodedb, but will speed up startup. Requires
                        2.3.11+ firmware.
  --debug               Show API library debug log messages
  --test                Run stress test against all connected Meshtastic devices
  --wait-to-disconnect [SECONDS]
                        How many seconds to wait before disconnecting from the device.
  --noproto             Don't start the API, just function as a dumb serial terminal.
  --listen              Just stay open and listen to the protobuf stream. Enables debug logging.
  --no-time             Deprecated. Retained for backwards compatibility in scripts, but is a no-op.

Power Testing:
  Options for power testing/logging.

  --power-riden POWER_RIDEN
                        Talk to a Riden power-supply. You must specify the device path, i.e. /dev/ttyUSBxxx
  --power-ppk2-meter    Talk to a Nordic Power Profiler Kit 2 (in meter mode)
  --power-ppk2-supply   Talk to a Nordic Power Profiler Kit 2 (in supply mode)
  --power-sim           Use a simulated power meter (for development)
  --power-voltage POWER_VOLTAGE
                        Set the specified voltage on the power-supply. Be VERY careful, you can burn things up.
  --power-stress        Perform power monitor stress testing, to capture a power consumption profile for the device (also requires --power-mon)
  --power-wait          Prompt the user to wait for device reset before looking for device serial ports (some boards kill power to USB serial port)
  --slog [SLOG]         Store structured-logs (slogs) for this run, optionally you can specifiy a destination directory

Remote Hardware:
  Arguments related to the Remote Hardware module

  --gpio-wrb GPIO_WRB GPIO_WRB
                        Set a particular GPIO # to 1 or 0
  --gpio-rd GPIO_RD     Read from a GPIO mask (ex: '0x10')
  --gpio-watch GPIO_WATCH
                        Start watching a GPIO mask for changes (ex: '0x10')

Tunnel:
  Arguments related to establishing a tunnel device over the mesh.

  --tunnel              Create a TUN tunnel device for forwarding IP packets over the mesh
  --subnet TUNNEL_NET   Sets the local-end subnet address for the TUN IP bridge. (ex: 10.115' which is the default)

If no connection arguments are specified, we search for a compatible serial device, and if none is found, then attempt a TCP connection to localhost.```

@codecov
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.04%. Comparing base (b73cc1f) to head (915066e).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #679      +/-   ##
==========================================
+ Coverage   60.69%   61.04%   +0.34%     
==========================================
  Files          24       24              
  Lines        3715     3748      +33     
==========================================
+ Hits         2255     2288      +33     
  Misses       1460     1460              
Flag Coverage Δ
unittests 61.04% <100.00%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ianmcorvidae ianmcorvidae merged commit 0bb4b31 into meshtastic:master Oct 4, 2024
@ianmcorvidae ianmcorvidae deleted the argument-groups branch October 4, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant