7 releases (2 stable)

new 2.0.0 Jun 22, 2024
1.0.0 Jun 22, 2024
0.0.6 Jun 10, 2024
0.0.2 May 28, 2024

#86 in Command line utilities

Download history 382/week @ 2024-05-27 39/week @ 2024-06-03 190/week @ 2024-06-10 237/week @ 2024-06-17

848 downloads per month

Custom license

670KB
126 lines

What's ?

It's a simple tool to clone directories contents from the local machine.

Installation

cargo install cloning

Usage

cloning -t '[{elapsed_precise}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}' -s source -d dest -p '==-'

Display help

cloning -h

Customize

Example

cloning -t '{spinner:.white} [{elapsed_precise}] [{bar:50.white}] {pos:>7}/{len:7} {msg}' -s source -d dest -c 250 -p '== '
  • Templates
    • bar: renders a progress bar. By default, 20 characters wide. The style string is used to color the elapsed part, the alternative style is used for the bar that is yet to render.
    • wide_bar: like bar but always fills the remaining space. It should not be used with wide_msg.
    • spinner: renders the spinner (current tick string). Note that spinners do not automatically tick by default. You either need to call enable_steady_tick or manually call tick.
    • prefix: renders the prefix set on the progress bar.
    • msg: renders the currently set message on the progress bar.
    • wide_msg: like msg but always fills the remaining space and truncates. It should not be used with wide_bar.
    • pos: renders the current position of the bar as integer
    • human_pos: renders the current position of the bar as an integer, with commas as the thousands separator.
    • len: renders the amount of work to be done as an integer
    • human_len: renders the total length of the bar as an integer, with commas as the thousands separator.
    • percent: renders the current position of the bar as a percentage of the total length (as an integer).
    • percent_precise: renders the current position of the bar as a percentage of the total length (with 3 fraction digits).
    • bytes: renders the current position of the bar as bytes (alias of binary_bytes).
    • total_bytes: renders the total length of the bar as bytes (alias of binary_total_bytes).
    • decimal_bytes: renders the current position of the bar as bytes using power-of-10 units, i.e. MB, kB, etc.
    • decimal_total_bytes: renders the total length of the bar as bytes using power-of-10 units, i.e. MB, kB, etc.
    • binary_bytes: renders the current position of the bar as bytes using power-of-two units, i.e. MiB, KiB, etc.
    • binary_total_bytes: renders the total length of the bar as bytes using power-of-two units, i.e. MiB, KiB, etc.
    • elapsed_precise: renders the elapsed time as HH:MM:SS.
    • elapsed: renders the elapsed time as 42s, 1m etc.
    • per_sec: renders the speed in steps per second.
    • bytes_per_sec: renders the speed in bytes per second (alias of binary_bytes_per_sec).
    • decimal_bytes_per_sec: renders the speed in bytes per second using power-of-10 units, i.e. MB, kB, etc.
    • binary_bytes_per_sec: renders the speed in bytes per second using power-of-two units, i.e. MiB, KiB, etc.
    • eta_precise: the remaining time (like elapsed_precise).
    • eta: the remaining time (like elapsed).
    • duration_precise: the extrapolated total duration (like elapsed_precise).
    • duration: the extrapolated total duration time (like elapsed).

Open dest directory

cloning src dest -t '[{elapsed_precise}] {bar:40.cyan/blue} {pos:>7}/{len:7} {msg}' -o

Demo

demo

Dependencies

~7–16MB
~192K SLoC