climake

Overview

climake or CLIMake is a simple, lightweight library for native argument parsing in Rust. It is designed to run without any dependancies apart from the standard library. This project does not aim to include "fancy" ux-orientated features of other Rust-based argument parsers but instead just aims to ge t the job done as uniformally, lightweight and as bug-free as possible.

Demonstration

Provided the following rust code is compiled as ./x:

``rust /// Inside func to hook onto insidenewarg` fn examplerun() { println!("Basic argparse working"); }

let newarg = Argument { shortcall: String::from("t"), standalonecall: Some(String::from("test")), help: None, run: Box::new(|| examplerun()), };

let cli = CLIMake { name: String::from("Test CLI"), description: None, args: vec![newarg], nonerun: None, };

cli.parse_args(); ```

We can use one of the following methods to call the objective example_run() function:

This will then output as stdout the following:

none Basic argparse working

Tada! We have got an argument parser!