Crates.io | argi |
lib.rs | argi |
version | 0.1.0-beta.5 |
source | src |
created_at | 2021-10-12 19:54:44.868064 |
updated_at | 2021-10-13 22:58:58.783882 |
description | Argument parsing for the future 🚀 |
homepage | |
repository | |
max_upload_size | |
id | 464183 |
size | 51,176 |
Argument parsing for the future 🚀
click
libraryThis library is intended to be a replacement for both heavier structopt
/clap
-based interfaces due to amount of features contained within, as well as slim ones based upon pico-args
due to the small workflow and compilation footprint. As this crate isn't fully battle-tested yet, smaller programs are a prime contender for usage with this library.
Place the following into your Cargo.toml
file:
[dependencies]
argi = "0.1.0-beta.5"
Complete demo (help page):
use argi::{cli, data};
fn main() {
cli!(
help: "Imaginary webapp program, allowing simple tasks",
launch: {
help: "Launches instance to given address",
run: (|ctx, _| todo!("Launch at port {:?}", data!(ctx => --port))),
--db [url]: { help: "Database URL" },
--bind [url]: { help: "Binding address" },
--port [port]: { help: "Port to hook onto" },
},
delete [int?]: {
help: "Deletes an optional id from the database",
run: (|_, data| todo!("Delete {:?}", data))
}
)
.launch();
}
You can find more of the examples shown below within the useful examples/
directory!
This project is dual-licensed under both MIT and Apache, so feel free to use either at your discretion. Links to the files are listed below: