Skip to content

rawqubit/rust-config-transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Config Transformer 🔄

A versatile CLI utility built with Rust for converting configuration files between JSON, YAML, and TOML formats. It automatically detects the format based on file extensions or allows manual specification.

Features

  • Multi-Format Support: Convert between JSON, YAML, and TOML.
  • Automatic Detection: Infers input and output formats from file extensions.
  • Pretty Printing: Generates well-formatted, human-readable output.
  • Robust Error Handling: Provides clear error messages for invalid configurations.

Installation

To build the tool from source, you need to have Rust and Cargo installed.

git clone https://github.com/rawqubit/rust-config-transformer.git
cd rust-config-transformer
cargo build --release

The binary will be available at target/release/rust-config-transformer.

Usage

rust-config-transformer --input <INPUT> --output <OUTPUT> [OPTIONS]

Options

  • -i, --input <INPUT>: Input file path.
  • -o, --output <OUTPUT>: Output file path.
  • -f, --from <FORMAT>: Input format (json, yaml, toml).
  • -t, --to <FORMAT>: Output format (json, yaml, toml).
  • -h, --help: Print help information.
  • -V, --version: Print version information.

Examples

Convert a JSON file to YAML:

rust-config-transformer --input config.json --output config.yaml

Convert a YAML file to TOML, explicitly specifying the formats:

rust-config-transformer --input settings.yml --output settings.toml --from yaml --to toml

About

A versatile CLI utility built with Rust for converting configuration files between JSON, YAML, and TOML formats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages