Crates.io | grace-cli |
lib.rs | grace-cli |
version | 0.1.1 |
source | src |
created_at | 2023-09-02 08:53:54.400471 |
updated_at | 2023-09-07 04:38:49.878459 |
description | CLI tool for processing files and strings. |
homepage | |
repository | https://github.com/meinbaumm/grace.git |
max_upload_size | |
id | 961600 |
size | 612,379 |
Image author: Мельк
CLI tool for processing files and strings.
Grace helps you organize your files by converting them to the proper case and clearing out unnecessary characters such as ` ' [ ] and many others.
Grace can also rename strings to the correct case and clear them of unnecessary characters.
Now Grace can renames files, directories and strings into a lot of cases, such as
Alternating
-> tHiS wAySnake
-> this_wayCamel
-> thisWayKebab
-> this-wayDot
-> this.wayHeader
-> This-WayNormal
-> this wayOriginal
-> "this way" (returns the string as it was)Pascal
-> ThisWayPath
-> this/waySentence
-> This wayTitle
-> This WayUpperSnake
-> THIS_WAYWindowsPath
-> this\wayYou can download suitable executable from https://github.com/meinbaumm/grace/releases and copy it in some directory that is listed in your PATH (e.g. ~/bin).
You may also use cargo to install grace from crates.io:
cargo install grace-cli
Grace is written in Rust. You may build it yourself with the help of cargo. Just clone this repository and execute the cargo build command in its main directory:
cargo build --release
Grace now has the name grace-cli
in crates.io.
But I prefer just grace
more.
To avoid writing grace-cli
every time, you can add an alias to your .bashrc or .zshrc file.
If you installed grace with cargo:
which grace-cli
Then copy the output and in your .bashrc or .zshrc file write
alias grace="~/./.cargo/bin/grace-cli"
Next source file like. And use with pleasure :)
source .zshrc
grace-cli --help
CLI tool for processing files and strings.
Usage: grace-cli <COMMAND>
Commands:
recase Recase string, file, or directory of files
sanitize Sanitize string of unnecessary characters
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
grace-cli recase file -f example\ file\ \[2023\].pdf -i snake --sanitize
Will recase example file [2023].pdf
file into snake case example_file_2023.pdf
, removing redundant symbols.
grace-cli recase files -d test-dir/ -i camel
Will recase all files in provided directory into camelCase. If you wand recase only files with specific extension, use -f/--formats
flag.
grace-cli recase files -d test-dir/ -i camel -f "pdf, epub"
If you wand recase directories too, you can write
grace-cli recase files -d test-dir/ -i camel -d
Grace also can rename files recursively, just provide -r/--recursive
flag.
grace-cli recase files -d test-dir/ -i camel -r
Will recase all files in provided directories and files in subdirectories.
Unfortunately, recursively renaming directories is not supported now.
grace-cli recase dir -f test-dir/ -i snake
Will recase test-dir/
into snake case.
grace-cli recase string "Some Long String You Want To Recase Into Sentence" -i sentence
Will return
Some long string you want to recase into sentence