Git Product home page Git Product logo

cleanup-files's Introduction

Logo

Quickly clean up chaos

Build Status Download count Current version Support me

Usage

Disclaimer:
This project was intended to check out rust and learn its concepts and principles. The code is kept simple and I've re-invented a lot to learn how it works (I'm aware of libraries such as clap and structop to build CLIs)

You can find the latest release here, keep in mind that some commands may not exist in older versions.

$ ./cleanup -h
Usage: cleanup <source> <target> [options...]

Flags:
  -d, --dry, --dry-run           Performs a dry-run, e.g. nothing get's moved.
  -h, --help                     Prints this help text.
  -v, --version                  Prints the current version.

Arguments:
  -l, --log-file <file|boolean>  Creates (or disables) a log-file in the target folder. Default is 'c
leanup.log'.
  -i, --include <extensions...>  Move only files with one of the following extensions.
  -e, --exclude <extensions...>  Exclude certain files by their extension.

Values:
  <source>                       Source directory. Default is the current directory.
  <target>                       Target directory (Default is source + .archive).

Examples

Command Explanation
./cleanup This will create a new ./.archive in the current director and move all files (except these which start with a dot and the executable itself) into .archive/[extension]/[file].[extension].
./cleanup . etc It'll still use the current dir as source (.) but will move the files into ./etc instead of ./.archive.
./cleanup -l --ext mp3,iso A cleanup.log file will be created inside of ./.archive with information about what has been moved. Files with the exension mp3 and iso are ignored and won't get moved.
./cleanup ../ ./bam --log-file ../my-log.txt Grabs file from the parent-directory and moves them into ./bam (the current directory). The log-file will be create in the current directory and is this time my-log.txt.

Building

This project is written in rust, clone it via git:

$ git clone https://github.com/Simonwep/cleanup-files

Afterwards you can either run cargo build or use ./release.sh to build a production-ready version of it.

release.sh will automatically create a checksums.txt file in /target/release with several checksums for the executable. If you're on a windows-machine the script will additionally download rcedit to set the icon of the .exe file.

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.