Expand description
notox is a tool to clean file names.
§Usage as a binary
# install notox
cargo install notox
# then use it (dry-run by default)
notox .
# to rename the file
notox -d .§Usage as a library
use std::collections::HashSet;
use std::path::PathBuf;
use notox::{notox, Notox, NotoxArgs, Output};
let paths: HashSet<PathBuf> = HashSet::from(["README.md".into(), "Cargo.toml".into()]);
let notox_args = NotoxArgs {
dry_run: true, // change here
// if using serde
// output: Output::JsonOutput {
// json: JsonOutput::JsonDefault,
// pretty: false,
// },
output: Output::Quiet
};
// as rust struct (recommended)
let res = Notox::new(¬ox_args).run(&paths);
// as function
let res = notox(¬ox_args, &paths);Coverage is available at https://n4n5.dev/notox/coverage/
Structs§
Enums§
- Json
Output - Type of JSON output
- Output
- Type of output
- Path
Change - Contains information about a result of a single file
Functions§
- check_
similar - Check if a vector of bytes is similar to a char
- convert_
four_ to_ u32 - Convert four bytes to a u32
- convert_
three_ to_ u32 - Convert three bytes to a u32
- convert_
two_ to_ u32 - Convert two bytes to a u32
- notox
- Do the program, return the Vector of result
The recommended usage is with the rust struct
Notox::new - parse_
args - Parse the arguments and return the options and the paths to check