From 86524a98485cbad0a1dfa88ee284510a92807912 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Sun, 3 Mar 2024 13:39:40 +0100 Subject: [PATCH] fix(417): Make vsock-addr and unix-socket conflict Closes #417 Providing both `--vsock-addr` and `--unix-socket` now throws an error: ```console $ oha --vsock-addr '1:3000' --unix-socket ./socket 'http://localhost:3000'` error: the argument '--vsock-addr ' cannot be used with '--unix-socket ' Usage: oha [FLAGS] [OPTIONS] For more information, try '--help'. ``` --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2cc25242..b8aea0b9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,13 +166,15 @@ Note: If qps is specified, burst will be ignored", #[cfg(unix)] #[clap( help = "Connect to a unix socket instead of the domain in the URL. Only for non-HTTPS URLs.", - long = "unix-socket" + long = "unix-socket", + group = "socket-type" )] unix_socket: Option, #[cfg(feature = "vsock")] #[clap( help = "Connect to a VSOCK socket using 'cid:port' instead of the domain in the URL. Only for non-HTTPS URLs.", - long = "vsock-addr" + long = "vsock-addr", + group = "socket-type" )] vsock_addr: Option, #[clap(