Skip to main content

ua_client/tui/
args.rs

1use clap::Parser;
2
3/// Terminal browser for OPC UA servers.
4///
5/// Note: server-certificate checks (time, hostname, application URI) are
6/// currently DISABLED by default — see the warning printed at startup.
7#[derive(Debug, Default, Parser)]
8#[command(
9    name = "ua-tui",
10    about = "Terminal browser for OPC UA servers",
11    long_about = None,
12    after_help = "KEYBOARD SHORTCUTS (inside the TUI):\n  \
13        Tab / Shift+Tab    Move focus between widgets (skips disabled ones)\n  \
14        Arrows / j / k     Move within the focused widget\n  \
15        Enter              Select node (expands/collapses if it has children)\n  \
16        Esc                Clear current selection\n  \
17        r                  Refresh selected node\n  \
18        p                  Copy browse path of selected node\n  \
19        n                  Copy NodeId of selected node\n  \
20        v                  Copy Value attribute of selected node\n  \
21        c                  Call selected Method (opens input dialog)\n  \
22        Alt+Left/Right     Resize tree width (when tree focused)\n  \
23        Alt+Up/Down        Resize attrs/refs split or log height (focus-dependent)\n  \
24        q / Ctrl+C         Quit (disconnects cleanly first)\n  \
25        ?                  Show in-app help"
26)]
27pub struct TuiArgs {
28    /// OPC UA endpoint URL (e.g. opc.tcp://localhost:4855). Pre-fills the
29    /// URL field; you still press Connect to connect.
30    #[arg(long, visible_alias = "endpoint", value_name = "URL")]
31    pub url: Option<String>,
32
33    /// Browse to this path once you connect. Slash-separated BrowseNames
34    /// starting from the address-space root, e.g. /Objects/Server/ServerStatus.
35    /// Segments may use 'ns=N:Name' for non-default namespaces.
36    #[arg(long, value_name = "PATH")]
37    pub path: Option<String>,
38}