Giter Club home page Giter Club logo

rimg's Introduction

rimg

Build & Test

Build

After installing Rust, run the below commands to build.

$ git clone https://github.com/Takashicc/rimg
$ cd rimg
$ cargo build --release
$ ./target/release/rimg --version
rimg 0.3.0

Commands

Rename

Rename files in each directory to sequential number.

This command will look recursively.

$ rimg rename -h
Rename files in each directory to sequential number

Usage: rimg rename [OPTIONS] <INPUT_DIR>

Arguments:
  <INPUT_DIR>  Target directory

Options:
  -d, --digit <DIGIT>            Number of digits for renaming [default: 4]
  -e, --extensions <EXTENSIONS>  Target file extension [default: jpg jpeg]
  -i, --initial <INITIAL>        Initial number [default: 1]
  -s, --step <STEP>              Number of steps to count each files [default: 1]
  -y, --yes                      Execute immediately or not
  -h, --help                     Print help information

$ rimg rename "~/test" -y
2 directories will be executed
There are no JPG files in test directory
Renaming JPG files in xxx directory
|############################################################| 24   /24    Renaming xxx

Compress

Compress each directory directly under the specified directory.

This command will NOT look recursively.

Currently supports rar and zip.

$ rimg compress -h
Compress files in each directory

Usage: rimg compress [OPTIONS] <INPUT_DIR>

Arguments:
  <INPUT_DIR>  Input directory

Options:
  -o, --output-dir <OUTPUT_DIR>    Output directory
  -f, --format-type <FORMAT_TYPE>  Compress file format type [default: rar]
  -v, --validate                   Check the compressed file is not corrupted after the file was created
      --validate-only              Just check the compressed file is not corrupted
  -y, --yes                        Execute immediately or not
  -h, --help                       Print help information

$ rimg compress "~/test" -v -y
2 directories will be executed
  [00:00:03] [##############################]  (0.0s) Compressed xxx.rar!
Compression Result
# ----------------- #
| Total    ->     2 |
| Created  ->     2 |
| Error    ->     0 |
# ----------------- #
  [00:00:01] [##############################]  (0.0s) OK
Validation Result
# ----------------- #
| Total    ->     2 |
| Valid    ->     2 |
| Invalid  ->     0 |
# ----------------- #

rimg's People

Contributors

dependabot[bot] avatar renovate[bot] avatar takashicc avatar

Watchers

 avatar

rimg's Issues

bug: rename時にソート順が自然になっていない

以下のようなファイルがあったとして、

A0.jpg
A1.jpg
A2.jpg
A3.jpg
A10.jpg
A11.jpg
A20.jpg

以下のコマンドでrenameしたとき、A10.jpgの次にA11.jpgが来るはずが、A20.jpgが来てしまう。

rimg rename ~/test -v

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.