Skip to content
/ rn Public

rn is a command line tool to rename files and directories.

License

Notifications You must be signed in to change notification settings

thled/rn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rn

Version MIT License Rust

rn is a command line tool to rename files and directories.

Its behavior is comparable with that of mv path/to/old_name path/to/new_name.
You can already write this quiet elegant like this mv path/to/{old_name,new_name}. But rn has a more intuitive syntax and is arguably more semantic.

Table of contents

Installation

There are different possible ways to install rn. You can choose one of the following.

Download binary

Archives of precompiled binaries for rn are available.

Package Manager

If you're an Arch Linux user and have an AUR helper like paru, then you can install rn from the AUR:

paru -S rn

Build binary

  1. Clone this repository:

    git clone [email protected]:thled/rn.git
  2. Change to project directory:

    cd rn
  3. Build and start the docker containers:

    docker-compose up -d
  4. Build the app:

    docker-compose exec app cargo build --release
  5. Copy binary:

    cp app/target/release/rn TARGET

Usage

$ rn SOURCE NEW_NAME

  • SOURCE = the file/directory to rename (possibly with absolute/relative path)
  • NEW_NAME = new name of the file/directory

$ rn --help for further assistance.

Examples

  • $ rn foo_file bar_file
  • $ rn path/to/foo_file bar_file
  • $ rn /absolute/path/to/foo_file bar_file
  • $ rn foo_dir bar_dir
  • $ rn path/to/foo_dir bar_dir
  • $ rn /absolute/path/to/foo_dir bar_dir

Development

Requirements

Enter container (required for following commands)

docker-compose exec app sh

Build

cargo build

Run

cargo run foo bar

Lint

cargo clippy

Fix

cargo fix

Format

cargo fmt

Test

cargo test

Watch

cargo watch -cx test -i tests/data

Contribute

Please do contribute! Issues and pull requests are welcome.

About

rn is a command line tool to rename files and directories.

Resources

License

Stars

Watchers

Forks

Packages

No packages published