MCPcopy Index your code
hub / github.com/08820048/untools

github.com/08820048/untools @v1.0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.0.8 ↗ · + Follow
8 symbols 15 edges 3 files 6 documented · 75%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

中文文档

Crates.io License rustc 1.77.0 Documentation GitHub stars GitHub forks GitHub issues Contributors

A Rust utility crate for converting variable names from camelCaseto snake_case.

Installation

Add the following dependency to your Cargo.toml file:

[dependencies]
untools = "1.0.0" # This is just an example. It is recommended to use the latest version number.

Usage

use untools::camel_to_snake;

fn main() {
    let camel_case_name = "myVariableName";
    let snake_case_name = camel_to_snake(camel_case_name, true);
    assert!("MY_VARIABLE_NAME', snake_case_name);
}
use untools::batch_convert;

fn main() {
    // Specify the input file, output file, naming convention, and whether to operate in silent mode.
    batch_convert("input.txt", "output.txt", true, false);
}

In the example above:

  • "input.txt" is the path to the input file containing variable names to be converted.
  • "output.txt" is the path to the output file where the converted variable names will be written.
  • true indicates that the variable names will be converted to SCREAMING_SNAKE_CASE. Set it to false for camelCaseconversion.
  • false indicates that the program will not run in silent mode.

CLI Usage

$ untools -h
Usage: untools [OPTIONS] <--camel-to-snake|--snake-to-camel|--batch <OUTPUT_FILE>> <INPUT>

Arguments:
  <INPUT>

Options:
  -c, --is-constant
      --camel-to-snake
      --snake-to-camel
      --batch <OUTPUT_FILE>
  -s, --silent
  -h, --help                 Print help
  -V, --version              Print version
$ untools --camel-to-snake "helloWorld" -c -s
HELLO_WORLD
$ untools --snake-to-camel "hello_world" -c -s
HelloWorld
$ untools --camel-to-snake "hello_world" -s
helloWorld
$ untools --batch "input.txt" "output.txt" -s 

Futures

Here are the features and improvements we plan to add to the tool in the future. If you have any suggestions or ideas, feel free to share!

  1. Support for Multiple Naming Conventions:
  2. Add support for other naming conventions such as SCREAMING_SNAKE_CASE.
  3. Batch Conversion Feature:
  4. :white_check_mark: Allow users to convert multiple variable names at once.
  5. Interactive Mode:
  6. :white_check_mark: Create an interactive command-line interface for a more intuitive user experience. #3
  7. File Processing Feature:
  8. :white_check_mark: Support batch conversion of variable names in files.
  9. Custom Rules:
  10. Enable users to define custom conversion rules.
  11. Integration with Editor Plugins:
  12. Develop editor pluginsto allow users to use the conversion tool directly in their editors.
  13. GUI Interface:
  14. Develop a graphical user interface for a more user-friendly experience.
  15. Support reverse conversion
  16. :white_check_mark: Convert underscores to PascalCase.

If you have any ideas or suggestions regarding the above features, feel free to raise them in the Issues section or directly submit a Pull Request.


License

This project is licensed under the MIT License - see the LICENSE file for details.

Core symbols most depended-on inside this repo

starts_with_digit
called by 2
src/utils.rs
camel_to_snake
called by 2
src/lib.rs
is_camel_or_pascal_case
called by 1
src/utils.rs
batch_convert
called by 1
src/lib.rs
snake_to_camel
called by 1
src/lib.rs
main
called by 0
src/main.rs

Shape

Function 6
Class 2

Languages

Rust100%

Modules by API surface

src/main.rs3 symbols
src/lib.rs3 symbols
src/utils.rs2 symbols

For agents

$ claude mcp add untools \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact