Works together with flags_data extension.
namespace flags utilities
implicit import ideal • machine • channels
implicit import ideal • machine • characters
separator pattern : option pattern[character] • new([singleton pattern[character] • new('=') .> pattern[character], singleton pattern[character] • new(':')])
dictionary[string, string] parse flags(readonly list[string] arguments, procedure[void, string] error reporter)
for index = 0; index < arguments • size; index += 1
if index < arguments • size
error reporter("Non-flag parameters found--don't know what to do!")
return arg dictionary
boolean boolean flag(dictionary[string, string] arg dictionary, string name)
not flag : "not" ++ flag name
if arg dictionary • contains key(not flag)
no flag : "no" ++ flag name
if arg dictionary • contains key(no flag)
if value is null
return false
return flag value != "false" && flag value != "no"
void finish(dictionary[string, string] arg dictionary, procedure[void, string] error reporter)
if arg dictionary • is not empty