Skip to main content

cli/commands/
local.rs

1use clap::{Args, Subcommand};
2
3#[derive(Subcommand, Debug)]
4pub enum LocalCommands {
5    /// Download a file from the remote host to the local machine
6    Download(LocalTransferCommand),
7    /// Upload a file from the local machine to the remote host
8    Upload(LocalTransferCommand),
9    /// Show the current session's local directory, connection status, and protocol version
10    Status,
11}
12
13#[derive(Args, Debug)]
14pub struct LocalTransferCommand {
15    /// Source path, resolved by whichever side owns it (remote for
16    /// download, local for upload)
17    pub source: String,
18    /// Destination path, resolved by the other side; defaults to the same
19    /// file name in that side's default directory
20    pub destination: Option<String>,
21    /// Overwrite an existing destination
22    #[arg(long)]
23    pub force: bool,
24    /// Show what would happen without transferring any data
25    #[arg(long)]
26    pub dry_run: bool,
27    /// Use scp instead of the default rsync
28    #[arg(long)]
29    pub scp: bool,
30}