Skip to content

Releases: AmosNimos/flag

Flag v3: Enhanced Flag Parsing for Bash Scripts

22 Apr 21:21
Compare
Choose a tag to compare

This release of the flag script includes improvements to its functionality and readability. Color variables are now defined locally within the print_help function, ensuring better scoping. Default value handling for flags without specified values has been enhanced, and the script retains its logic for concatenating values for flags with multiple arguments. These updates enhance the overall usability and maintainability of the script.

You can now use the script as follow:
flag -a hello world -b --text "world-hello" --TEXT Some text

this will initialize the following variables:

flag_a="hello world"
flag_b="1"
flag_text="world-hello"
flag_TEXT="Some text"