Coder Social home page Coder Social logo

burne's Introduction

burne

Build Status Minimum supported rustc version: 1.53

BUlk ReName by Editor.

Usage

For usage, see burne --help.

$ burne --help
burne
Renames child files in a directory using editor

USAGE:
    burne [FLAGS] [OPTIONS] [source-dir]

ARGS:
    <source-dir>
            Source directory that contains files to rename [default: .]

FLAGS:
    -n, --dry-run
            Instead of running rename, just prints filenames before and after the rename

    -h, --help
            Prints help information

    -z, --null-data
            Separates the lines by NUL characters

    -p, --parents
            *UNIMPLEMENTED*: Makes parent directories for destination paths as needed.

            Not yet implemented.

    -V, --version
            Prints version information


OPTIONS:
    -e, --escape <escape>
            Escape method [default: none] [possible values: none, percent, percent-encoding]

Escape method

Sometimes you need to handle special characters such as \n and/or invalid UTF-8 sequences. This is when --escape shines.

--escape=none (default) does not do any escape. This would be most intuitive for editing. However, burne fails if the paths before/after rename includes special characters such as the line separator and filenames cannot be separated unambiguously.

--escape=percent applies percent encoding to lines in the file to be edited. For example, when you do touch hello$'\n'world and run burne with --escape percent, then you will see hello%0Aworld in your editor. You can use percent-encoded sequences (such as %20 for a whitespace) when you write new filenames.

--escape=percent-ascii is similar to --escape=percent, but this escapes more characters: not only ASCII control characters, but also all non-ASCII characters! If your editor cannot handle arbitrary UTF-8 strings, you can use this method to read and write only ASCII characters.

Null data

Usually, line feed (\n) character is used as a line separator in the file you edit. However, sometimes source/destination files can contain \n character, and you will want to handle such special characters unambiguously in your editor without escape.

--null-data let burne use \0 (NUL character) as a line separator. Paths cannot contain \0, so this makes separation of unescaped filenames unambiguous.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

burne's People

Contributors

lo48576 avatar

Watchers

 avatar

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.