[][src]Crate climake

The simple, dependency-less cli library ✨

Example 📚

This example panics
use climake::{Argument, CLIMake, DataType};

fn main() {
    let args = &[
        Argument::new(
            &['o'],
            &["output", "out"],
            Some("Example output arg"),
            DataType::Files,
        ).unwrap(),
        Argument::new(
            &['a', 'b', 'c'],
            &[],
            Some("Alphabet!"),
            DataType::None,
        ).unwrap(),
    ];

    let cli = CLIMake::new(args, Some("A showcase CLI to demonstrate climake"), None).unwrap();

    println!("Args used:\n{:#?}", cli.parse());
}

Installation 🚀

Simply add the following to your Cargo.toml file:

[dependencies]
climake = "2.1"

Structs

Argument

An allowed argument for a new CLI

CLIMake

Main holder structure of entire climake library, used to create new CLIs.

UsedArg

Given for when a user used a valid Argument and any data given alongside it

Enums

CLIError

The primary error enum for climake, used when an error is encountered to use downstream

CallType

The ways users can call a given Argument

DataType

The type of data an argument accepts. The enum that hands the user's inputs to you is PassedData, extending from UsedArg

PassedData

Data collected from user input based upon wanted data from PassedData