Crate notox

Crate notox 

Source
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(&notox_args).run(&paths);
// as function
let res = notox(&notox_args, &paths);

Coverage is available at https://n4n5.dev/notox/coverage/

Structs§

Notox
Notox struct
NotoxArgs
Options for the program

Enums§

JsonOutput
Type of JSON output
Output
Type of output
PathChange
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