From c93be3493dcac9ede5d5645a13e30134e26657b0 Mon Sep 17 00:00:00 2001 From: Simon Kellet Date: Thu, 9 Jul 2026 19:41:12 +0100 Subject: [PATCH] updated for required flags + TODO section --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c65a517..3d2062a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,15 @@ This a very simple implementation of Go-like flags in Odin fleg.parse_flags() ``` +You can also marks flags as **required"**. These will still be parsed, however will hault the application until they are passed: + +```odin + import "fleg" + isRunning: bool + fleg.BoolVar(&isRunning, "isRunning", true, "A select piece of code is running!", required = true) + fleg.parse_flags() +``` + ***Supports: bool, int, string, f32*** And on the command line, you pass flags like so: @@ -54,7 +63,20 @@ The package also contains a help context menu. This comes default and can be cal ## Custom Flag Format -A custom flag format can be created by overwriting the strings *FLAG_START_CHAR* and *FLAG_SEP_CHAR*. These cannot be the same however! +A custom flag format can be created by overwriting the strings *FLAG_START_CHAR* and *FLAG_SEP_CHAR*. (These *cannot* be the same however!) + +```odin + fleg.FLAG_START_CHAR = "--" + fleg.FLAG_SEP_CHAR = ":" +``` + +Flags will now be in the format: + +```txt + --isString:"......" +``` + +**Note:** Any change to the format of the flags is also relfected upon the "help" flag. ## Custom Allocator @@ -69,4 +91,11 @@ If needed, you are able to setup a custom allocator like so: fleg.init_custom_allocator(arena_alloc) defer fleg.destroy() //clean up flags -``` \ No newline at end of file +``` + +## TODO + +* More type support +* Better logging of INFO and ERROR's +* String validation (perhaps not needed?) +* Array support (e.g. **--isArray:{4,5,6,7}**) \ No newline at end of file