This commit is contained in:
2026-05-12 23:19:12 +09:00
parent b19d9d25f7
commit cde37d516b
21 changed files with 634 additions and 52 deletions

View File

@@ -24,6 +24,8 @@ enum Cmd {
Connection(ConnectionCmd),
#[command(alias = "c")]
Connect(ConnectArgs),
#[command(alias = "sh")]
Shell(ShellArgs),
Keys(KeysCmd),
}
@@ -84,6 +86,17 @@ struct ConnectArgs {
no_pty: bool,
}
#[derive(Args, Debug)]
struct ShellArgs {
session: String,
#[arg(long)]
connection: Option<u64>,
#[arg(long)]
shell: Option<String>,
#[arg(long)]
no_pty: bool,
}
#[derive(Args, Debug)]
struct KeysCmd {
#[command(subcommand)]
@@ -146,6 +159,7 @@ async fn run() -> Result<()> {
ConnectionSub::List { session } => cmd::connection::list(&client, session).await,
},
Cmd::Connect(a) => cmd::connect::run(&client, a.session, a.connection_id, a.no_pty).await,
Cmd::Shell(a) => cmd::shell::run(&client, a.session, a.connection, a.shell, a.no_pty).await,
Cmd::Keys(k) => match k.sub {
KeysSub::Append { key, file, url } => cmd::keys::append(&client, key, file, url).await,
KeysSub::Rm { key, file, url } => cmd::keys::remove(&client, key, file, url).await,