grey

Crates.iogrey
lib.rsgrey
version0.1.1
sourcesrc
created_at2023-08-03 13:53:56.159219
updated_at2023-08-11 08:46:57.874559
descriptionGrey is a minimal package to build console applications
homepage
repositoryhttps://github.com/coswat/grey/
max_upload_size
id933660
size10,596
coderswat (coswat)

documentation

README

Grey

Grey is a minimal rust package to build console applications quickly

Installation

Run the following Cargo command in your project directory:

cargo add grey

Or add the following line to your Cargo.toml:

grey = "0.1.0"

Usage

use grey::builder::{App, Commands};
use grey::vars;

fn main() {
    let cmd: String = vars::get_cmd();
    // Create a new app
    let mut app: App = App::new();
    app.name("Test CLI");
    app.description("Testing this cli app");
    app.version("1.0.0");
    // Create new Commands
    let mut commands: Commands = Commands::new();
    // add a command
    commands.add("test", test_cmd , "test command");
    // run the commands
    app.run(cmd, commands);
}

fn test_cmd(_app: &App) -> u8 {
    println!("Hello from test");
    0
}

checkout the docs for the details, Docs

License

The grey package is open-sourced software licensed under the MIT license.

Commit count: 13

cargo fmt