forked from mincomk/rsh
1
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user