mirror of
https://git.proxmox.com/git/pve-xtermjs
synced 2025-10-04 16:19:20 +00:00
termproxy: avoid gluing words together in CLI option names
Separate auth-port and auth-socket with a minus to make them easier to read. Fallback to the old style for `authport` which is pre-existing and used by, e.g. PBS. As the second option, now named `auth-socket`, got only introduced very recently and was not shipped in any package, we can ignore backwards compat for it. Update and slightly rework the usage output too. Note that even though this is an internal tool the cost doing so is small and it can only help, e.g. on using this manually and/or during debugging. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
4b8568cb4f
commit
41f91fd42c
@ -11,8 +11,8 @@ Arguments:
|
|||||||
<terminal-cmd>... The command to run connected via a proxied pty
|
<terminal-cmd>... The command to run connected via a proxied pty
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
--authport <authport> Port to relay auth-request, default 85
|
--auth-port <port> Port to relay auth-request, default 85
|
||||||
--authsocket <authsocket> Unix socket to relay auth-request (conflicts with --authport)
|
--auth-socket <socket> Unix socket to relay auth-request (conflicts with --auth-port)
|
||||||
--port-as-fd Use <listen-port> as file descriptor.
|
--port-as-fd Use <listen-port> as file descriptor.
|
||||||
--path <path> ACL object path to test <perm> on.
|
--path <path> ACL object path to test <perm> on.
|
||||||
--perm <perm> Permission to test.
|
--perm <perm> Permission to test.
|
||||||
@ -91,7 +91,12 @@ impl Options {
|
|||||||
let acl_path = args.value_from_str("--path")?;
|
let acl_path = args.value_from_str("--path")?;
|
||||||
let acl_permission = args.opt_value_from_str("--perm")?;
|
let acl_permission = args.opt_value_from_str("--perm")?;
|
||||||
let api_daemon_address = {
|
let api_daemon_address = {
|
||||||
let auth_port: Option<u16> = args.opt_value_from_str("--authport")?;
|
// TODO: remove with next major releases based on Debian trixie, after checking if all
|
||||||
|
// product switched to new auth-port variant!
|
||||||
|
let legacy_authport: Option<u16> = args.opt_value_from_str("--authport")?;
|
||||||
|
let auth_port: Option<u16> = args
|
||||||
|
.opt_value_from_str("--auth-port")?
|
||||||
|
.or_else(|| legacy_authport);
|
||||||
let auth_socket: Option<String> = args.opt_value_from_str("--auth-socket")?;
|
let auth_socket: Option<String> = args.opt_value_from_str("--auth-socket")?;
|
||||||
match (auth_port, auth_socket) {
|
match (auth_port, auth_socket) {
|
||||||
(Some(auth_port), None) => DaemonAddress::Port(auth_port),
|
(Some(auth_port), None) => DaemonAddress::Port(auth_port),
|
||||||
|
Loading…
Reference in New Issue
Block a user