Giter VIP home page Giter VIP logo

filename-fix's Introduction

Filename Fix

A tool for fix filename

Features

  • Fix filename number prefix, skip when dir or file without number prefix
  • Fix filename space with separator replacement, ignore the space before filename and file extension
  • Fix file extension lowercase or uppercase, ignore file without extension
  • ... ...

Installation

$ cargo install filenamefix

Usage

USAGE:
    filenamefix CMD [<params>] <dirname>
CMD:
    number
    space
    ext
ARGS:
    <params> 
        (CMD: number)
        Number of digits in number prefix of filename, default 2
        (CMD: space)
        The separator that spaces are replaced with, default "_"
        (CMD: ext)
        If "upper", make the file extension uppercase, otherwise lowercase, default lowercase
    <dirname> dirname of files to fix

Examples

$ filenamefix number 3 /example/path
"01.test1.rs" -> "001.test1.rs"
"2-test2.rs" -> "002.test2.rs"
"0003.test.rs" -> "003.test.rs"
"4test.rs" -> "004.test.rs"

$ filenamefix number /example/path
"01--test1.rs" -> "01.test1.rs"
"2-test2.rs" -> "02.test2.rs"
"0003.test.rs" -> "03.test.rs"
"4test.rs" -> "04.test.rs"

$ filenamefix space - /example/path
"a b c.rs" -> "a-b-c.rs"
"a b c" -> "a-b-c"
"b c d .rs" -> "b-c-d.rs"
" c d e.rs" -> "c-d-e.rs"

$ filenamefix space /example/path
"a b c.rs" -> "a_b_c.rs"
"a b c" -> "a_b_c"
"b c d .rs" -> "b_c_d.rs"
" c d e.rs" -> "c_d_e.rs"

$ filenamefix ext upper /example/path
"a.rs" -> "a.RS"
"b" -> "b"
"c.RS" -> "c.RS"

$ filenamefix ext /example/path
"a.rs" -> "a.rs"
"b" -> "b"
"c.RS" -> "c.rs"

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.