#parser #flags #string #arguments-parser #long-flag

flag-parser

Parses flags like "-a" or "--long-flag" in a given string

2 releases

0.1.1 May 12, 2023
0.1.0 May 10, 2023

#199 in #flags

MIT license

5KB
83 lines

#Flag Parser Argument parsing for command line flags.

Usage

let input = "-a -b -c -d --long-flag-a --long-flag-b --long-flag-c";
let flags = flag_parser::get_flags(input);
// flags = ["a", "b", "c", "d", "long-flag-a", "long-flag-b", "long-flag-c"]

flags.contains("a") // true

No runtime deps