From c9b08f4a01f5df4e6e1c7cdd7942c0ed3bc2640d Mon Sep 17 00:00:00 2001 From: Rob Donnelly Date: Tue, 1 Aug 2023 17:11:45 -0700 Subject: [PATCH] Rename --virtual and --physical options to --create and --attach respectively Closes #10 --- Cargo.toml | 2 +- README.md | 26 +++++++++++++------------- src/cli.rs | 24 ++++++++++++------------ tests/snapshots/cli-help-long.txt | 24 ++++++++++++------------ 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 88cc317..ef4fe26 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ description = "Create virtual serial ports, connect them to physical serial port authors = ["Rob Donnelly"] license = "MIT OR Apache-2.0" repository = "https://github.com/rfdonnelly/vsp-router" -keywords = ["serial", "socat", "ttybus", "virtual", "router"] +keywords = ["serial", "socat", "ttybus", "virtual", "router", "com0com", "hub4com"] categories = ["command-line-utilities"] [profile.release] diff --git a/README.md b/README.md index 31e694b..70aaca2 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Create virtual serial ports, connect them to physical serial ports, and create routes between them all. -vsp-router was created to connect two terminal emulators to the same physical RS-232 [serial console](https://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/intro-why.html). +Vsp-router was created to connect two terminal emulators to the same physical RS-232 [serial console](https://tldp.org/HOWTO/Remote-Serial-Console-HOWTO/intro-why.html). [![asciicast](https://asciinema.org/a/519137.svg)](https://asciinema.org/a/519137) @@ -23,9 +23,9 @@ Multiplex two virutal serial ports to a single physical serial port. ```sh vsp-router \ - --virtual 0 \ - --virtual 1 \ - --physical 2:/dev/ttyUSB0 \ + --create 0 \ + --create 1 \ + --attach 2:/dev/ttyUSB0 \ --route 0:2 \ --route 1:2 \ --route 2:0 \ @@ -36,9 +36,9 @@ Multiplex two virutal serial ports to a third virtual serial port. ```sh vsp-router \ - --virtual 0 \ - --virtual 1 \ - --virtual 2 \ + --create 0 \ + --create 1 \ + --create 2 \ --route 0:2 \ --route 1:2 \ --route 2:0 \ @@ -51,9 +51,9 @@ In terminal A ```sh cargo run -- \ - --virtual 0 \ - --virtual 1 \ - --virtual 2 \ + --create 0 \ + --create 1 \ + --create 2 \ --route 0:2 \ --route 1:2 \ --route 2:0 \ @@ -105,9 +105,9 @@ vsp-router ```sh vsp-router \ - --virtual 0 \ - --virtual 1 \ - --virtual 2 \ + --create 0 \ + --create 1 \ + --create 2 \ --route 0:1 \ --route 0:2 \ --route 1:0 \ diff --git a/src/cli.rs b/src/cli.rs index 1fae830..278b9f1 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -23,39 +23,39 @@ pub(crate) struct Cli { /// /// Examples: /// - /// --virtual path/to/file + /// --create path/to/file /// /// The path is 'path/to/file' and the ID is 'file'. /// - /// --virtual 0:dev/ttyUSB0 + /// --create 0:dev/ttyUSB0 /// /// The path is '/dev/ttyUSB0' and the ID is '0'. - #[arg(long = "virtual", id = "VIRTUAL", verbatim_doc_comment)] + #[arg(long = "create", id = "CREATE", verbatim_doc_comment)] pub(crate) virtuals: Vec, - /// Open a physical serial port. + /// Attach to an existing serial port. /// /// The argument takes the following form: '[:][,]' /// /// If ID is not specified, the ID is set to the basename of the path. If baud rate is not specified, /// the baud rate defaults to 9600. /// - /// Can use multiple times to attached multiple physical serial ports. + /// Can use multiple times to attach multiple serial ports. /// /// Examples: /// - /// --physical /dev/ttyUSB0 + /// --attach /dev/ttyUSB0 /// /// The path is '/dev/ttyUSB0', the ID is 'ttyUSB0', and the baud rate is 9600. /// - /// --physical 1:/dev/ttyUSB0 + /// --attach 1:/dev/ttyUSB0 /// /// The path is '/dev/ttyUSB0', the ID is '1', and the baud rate is 9600. /// - /// --physical 1:/dev/ttyUSB0,115200 + /// --attach 1:/dev/ttyUSB0,115200 /// /// The path is '/dev/ttyUSB0', the ID is '1', and the baud rate is 115200. - #[arg(long = "physical", id = "PHYSICAL", verbatim_doc_comment)] + #[arg(long = "attach", id = "ATTACH", verbatim_doc_comment)] pub(crate) physicals: Vec, /// Create a route between a source port and a destination port. @@ -85,9 +85,9 @@ const CLAP_AFTER_HELP: &str = color_print::cstr!( both virtual serial ports. vsp-router \\ - --virtual 0 \\ - --virtual 1 \\ - --physical 2:/dev/ttyUSB0,115200 \\ + --create 0 \\ + --create 1 \\ + --attach 2:/dev/ttyUSB0,115200 \\ --route 0:2 \\ --route 1:2 \\ --route 2:0 \\ diff --git a/tests/snapshots/cli-help-long.txt b/tests/snapshots/cli-help-long.txt index 0497255..347e9f6 100644 --- a/tests/snapshots/cli-help-long.txt +++ b/tests/snapshots/cli-help-long.txt @@ -3,7 +3,7 @@ Create virtual serial ports, connect them to physical serial ports, and create r Usage: vsp-router [OPTIONS] Options: - --virtual + --create Create a virtual serial port. NOTE: This option is only applicable on POSIX platforms. This option is @@ -17,35 +17,35 @@ Options: Examples: - --virtual path/to/file + --create path/to/file The path is 'path/to/file' and the ID is 'file'. - --virtual 0:dev/ttyUSB0 + --create 0:dev/ttyUSB0 The path is '/dev/ttyUSB0' and the ID is '0'. - --physical - Open a physical serial port. + --attach + Attach to an existing serial port. The argument takes the following form: '[:][,]' If ID is not specified, the ID is set to the basename of the path. If baud rate is not specified, the baud rate defaults to 9600. - Can use multiple times to attached multiple physical serial ports. + Can use multiple times to attach multiple serial ports. Examples: - --physical /dev/ttyUSB0 + --attach /dev/ttyUSB0 The path is '/dev/ttyUSB0', the ID is 'ttyUSB0', and the baud rate is 9600. - --physical 1:/dev/ttyUSB0 + --attach 1:/dev/ttyUSB0 The path is '/dev/ttyUSB0', the ID is '1', and the baud rate is 9600. - --physical 1:/dev/ttyUSB0,115200 + --attach 1:/dev/ttyUSB0,115200 The path is '/dev/ttyUSB0', the ID is '1', and the baud rate is 115200. @@ -79,9 +79,9 @@ Examples: both virtual serial ports. vsp-router / - --virtual 0 / - --virtual 1 / - --physical 2:/dev/ttyUSB0,115200 / + --create 0 / + --create 1 / + --attach 2:/dev/ttyUSB0,115200 / --route 0:2 / --route 1:2 / --route 2:0 /