Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.
/ climake Public archive

The simplistic, dependency-free cli library ✨

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

rust-cli/climake

Repository files navigation

climake

The simplistic, dependency-free cli library ✨


This branch represents the unpublished rewrite version of climake with many advantages compared to the original version which is no longer developed upon!

Example 📚

Demo of a simple package manager:

use climake::prelude::*;

fn main() {
    let package = Argument::new(
        "The package name",
        vec!['p', 'i'],
        vec!["pkg, package"],
        Input::Text,
    );

    let add = Subcommand::new("add", vec![&package], vec![], "Adds a package");
    let rem = Subcommand::new("rem", vec![&package], vec![], "Removes a package");

    let cli = CliMake::new(
        "MyPkg",
        vec![],
        vec![&add, &rem],
        "A simple package manager demo",
        "1.0.0",
    );

    let parsed = cli.parse();

    for subcommand in parsed.subcommands {
        if subcommand.inner == &add {
            println!("Adding package {:?}..", subcommand.arguments[0]);
        } else if subcommand.inner == &rem {
            println!("Removing package {:?}..", subcommand.arguments[0]);
        }
    }
}

Installation 🚀

Simply add the following to your Cargo.toml file:

[dependencies]
climake = "3.0.0-pre.1" # rewrite isn't out just yet!

License

This library is duel-licensed under both the MIT License (LICENSE-MIT) and Apache 2.0 License (LICENSE-APACHE), you may choose at your discretion.

About

The simplistic, dependency-free cli library ✨

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Languages