Module confirm

Module confirm 

Source
Expand description

Transmit confirmation prompt and script-mode gating. Transmit confirmation prompt and script-mode gating.

Every transmit command in the REPL (cq, beacon, position, msg, echo, link) calls tx_confirm before keying the radio. This guards blind operators from accidentally transmitting on air by mistyping an argument or pasting the wrong line at the prompt.

Two global atomic flags steer the prompt behaviour:

  • CONFIRM_TX (default true) - require the prompt at all. Turned off globally by --yes or confirm off.
  • SCRIPT_MODE (default false) - the REPL is running a non-interactive script (stdin piped or --script passed). In script mode the prompt cannot be answered, so every transmit command aborts with a clear error unless confirmation has been explicitly disabled via --yes.

Statics§

CONFIRM_TX
When true (the default) every transmit command prompts the user before keying the radio. Cleared by --yes on the command line and by the interactive confirm off command.
SCRIPT_MODE
When true the REPL is running under a script or --script file. Prompts cannot be answered, so tx_confirm prints an error and returns false unless CONFIRM_TX is also cleared.

Functions§

is_required
Whether a transmit confirmation prompt is currently required.
set_required
Enable or disable transmit confirmation.
set_script_mode
Mark the REPL as running under a non-interactive script.
tx_confirm
Prompt the user to confirm a transmit action.