| Crates.io | noshell-macros |
| lib.rs | noshell-macros |
| version | 0.2.0 |
| created_at | 2025-03-08 21:31:25.919725+00 |
| updated_at | 2025-03-30 16:41:40.446638+00 |
| description | noshell, a no_std argument parser and a shell for constrained systems. |
| homepage | https://github.com/inthehack/noshell |
| repository | https://github.com/inthehack/noshell |
| max_upload_size | |
| id | 1584807 |
| size | 42,811 |
noshell, a no_std argument parser and a shell for constrained systems.
This crate provides a working but yet minimal implementation of a argument parser. It could be used for parsing command line arguments in applications that require a shell for instance.
This crate does not rely on crate alloc but heapless for the result of argument parsing. This
could be mitigated and improved in a near future. As such, it could be used in very constrained and
critical embedded developments.
#[derive(Debug, noshell::Parser)]
struct MyArgs {
retries: Option<u32>,
}
fn main() -> {
let cmdline = &["--retries", "3"];
let args = MyArgs::parser(cmdline).unwrap();
if let Some(retries) = args.retries {
println!("You have {} retries left!", retries);
}
}
This crate is still a work in progress and is subject to huge changes in its API.
noline crate, waiting for a custom handling of terminal escape codes.Option<Vec<_>> or Vec<_> for instance.Please feel free to email me with suggestions or directly propose a Pull Request with some valuable contribution. As it is the beginning of the project, I will take time to studi every contribution.
This work is licensed under either
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
I would like to give a big thank to the creator and contributors of the crate
clap, which I draw a lot of inspiration from.