Skip to content

llComodino/qrustcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

!!! This Repo is a mirror of qrustcp and will not be further updated !!!

QRustCP ( qr-rust-copy | crust-copy )

Thought that I should implement my version of qrcp just because I really don't like go.

What language wold best fit this task? Rust of course! Why?

  • It's blazing fast
  • It's safe
  • Other justific-VALID REASONS ... There isn't much more to it.

Installation

cargo install --git https://gitlab.com/comodino/qrustcp.git --branch master

How it works

The CLI supports two commands:

  • send, to send one or multiple files
  • receive, to receive one or multiple files

They both have subcommands:

Send arguments

pub struct SendArgs {
    /// Files to send
    #[arg(required = true)]
    pub files: Vec<PathBuf>,

    /// Compression format
    #[arg(short, long, default_value = "bz2")]
    pub compression: CompressionFormat,

    /// Port to use (random if not specified)
    #[arg(short, long)]
    pub port: Option<u16>,

    /// Don't show QR code
    #[arg(long)]
    pub no_qr: bool,

    /// Timeout in seconds (default: no timeout)
    #[arg(short, long)]
    pub timeout: Option<u64>,
}

Receive arguments

pub struct ReceiveArgs {
    /// Output directory for received files
    #[arg(short, long, default_value = ".")]
    pub output: PathBuf,

    /// Compression format for multiple files
    #[arg(short, long, default_value = "bz2")]
    pub compression: CompressionFormat,

    /// Port to use (random if not specified)
    #[arg(short, long)]
    pub port: Option<u16>,

    /// Don't show QR code
    #[arg(long)]
    pub no_qr: bool,

    /// Timeout in seconds (default: no timeout)
    #[arg(short, long)]
    pub timeout: Option<u64>,
}

When ran it tries to create open a server with an endpoint in the local network.

The webapp is embedded in the code, which is a clever way to make it faster, while also being a terrible way of editing it.

(All the HTML/CSS/JS code is AI generated)

If it succeds then it will try to either locate the files supplied and proceed to compress them before sending them out, or wait for a connection and compress then download the files uploaded.

When uploading/downloading multiple files they are compressed by default, using bz.

One can choose not to show the QR code.


Usage

# send file(s)
qrustcp send [ -c, --compression { gz, bz, xz, zip } ] [FILE...]

# receive file(s)
qrustcp receive [ -c, --compression { gz, bz, xz, zip } ] [ -o, --output <outname> ]

Building (is this even necessary?)

cargo build # debug build
cargo build --release # release build

About

Rust QR Copy CLI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages