diff --git a/web/CXM_web_arg_utils.anubis b/web/CXM_web_arg_utils.anubis index 4b0a285..832b813 100644 --- a/web/CXM_web_arg_utils.anubis +++ b/web/CXM_web_arg_utils.anubis @@ -129,6 +129,18 @@ public define Maybe(String) } . +public define Maybe(Bool) + get_mb_Bool + ( + List(Web_arg) lwa, + String arg_name + ) = + if web_arg_value(lwa, arg_name) is + { + not_found then failure, + found(value) then success(to_Bool(value)) + }. + public define Bool get_Bool ( @@ -137,8 +149,8 @@ public define Bool ) = if web_arg_value(lwa, arg_name) is { - not_found then false, - found(_) then true + not_found then false, + found(value) then true }. public define Bool -- libgit2 0.21.4