Altr: Smart CLI Refactoring Tool
Overview
Altr is a robust command-line refactoring tool designed to effortlessly enhance your codebase while maintaining your preferred casing styles.
Try it out on your browser: https://altr-5oz.pages.dev 🦀
How to Use
Execute Altr with the following command:
Example
Let's take a look at a practical scenario using a file named programmer.js, where we want to rename "programmer" to "rustProgrammer".
const programmer = ;
// Updating the name for the PROGRAMMER
Executing the command:
Results in the following updated file:
const rustProgrammer = ;
// Updating the name for the RUST_PROGRAMMER
Altr intelligently handles the replacement, considering the casing styles of both the original term and the specified replacement term. For instance, if we run:
The tool adjusts the file accordingly:
const rust_programmer = ;
// Updating the name for the RUST_PROGRAMMER
Notice how Altr adapts to the casing requirements of the replacement term.
IO Support
Altr supports taking in input from stdin and passing it to stdout
|
You can also specify the output location
You can use "-" as path to indicate stdin or stdout as well
Installation
Altr is easily installed using cargo: