From b45ce6c8737af6a511ea64354cc39f7f39ee26db Mon Sep 17 00:00:00 2001 From: dcodesdev <101001810+dcodesdev@users.noreply.github.com> Date: Fri, 31 May 2024 10:20:47 +0300 Subject: [PATCH] default user set to root --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 11 ++++++++++- src/cli.rs | 7 ++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 10afbb1..8439a5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,7 +211,7 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "fast-scp" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "clap", diff --git a/Cargo.toml b/Cargo.toml index e8c1c21..420790f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fast-scp" -version = "0.1.3" +version = "0.1.4" description = "A fast and simple scp CLI tool" license = "MIT" repository = "https://github.com/dcodesdev/fast-scp" diff --git a/README.md b/README.md index 70e4987..3b4928a 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,18 @@ A Rust CLI tool to copy files from your linux remote server to your local machin ## Example ```bash -fast-scp receive --host --user --private-key [path-to-private-key] +fast-scp receive --host ``` +### Parameters + +- `remote-path`: The path to the file or directory on the remote server. +- `local-path`: The path to the directory on the local machine where the files will be copied to. +- `host`: The IP address or hostname of the remote server. +- `user` (optional): The username to use to connect to the remote server. Default is `root`. +- `private-key` (optional): The path to the private key to use to connect to the remote server. Default is `~/.ssh/id_rsa`. +- `replace` (optional): If set, the local file will be replaced if it already exists. Default is `false`. + ## License Licensed under MIT License. See [LICENSE](LICENSE) for more information. diff --git a/src/cli.rs b/src/cli.rs index 69c1d8c..73e21dd 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -21,7 +21,12 @@ pub enum Commands { #[clap(long, help = "Remote host to connect to")] host: String, - #[clap(short, long, help = "Remote username to connect as")] + #[clap( + short, + long, + help = "Remote username to connect as", + default_value = "root" + )] user: String, #[clap(short, long, help = "Path to private key")]