Crates.io | grey |
lib.rs | grey |
version | 0.1.1 |
source | src |
created_at | 2023-08-03 13:53:56.159219 |
updated_at | 2023-08-11 08:46:57.874559 |
description | Grey is a minimal package to build console applications |
homepage | |
repository | https://github.com/coswat/grey/ |
max_upload_size | |
id | 933660 |
size | 10,596 |
Grey is a minimal rust package to build console applications quickly
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"
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
The grey package is open-sourced software licensed under the MIT license.