@@ -223,10 +223,10 @@ pub fn positional_arguments(
223
223
next ( args )
224
224
}
225
225
226
- /// A Bool decoder that returns False if value is not present
226
+ /// Decode a command line flag as a Bool. Returns False if value is not present
227
227
/// ```gleam
228
228
/// let decoder = {
229
- /// use verbose <- zero.field( "v", clad.flag())
229
+ /// use verbose <- clad.flag("verbose", "v", clad.flag())
230
230
/// zero.success(verbose)
231
231
/// }
232
232
/// let result = clad.decode(["-v"], decoder)
@@ -256,23 +256,6 @@ fn optional_field(
256
256
next : fn ( Option ( t) ) -> Decoder ( final) ,
257
257
) -> Decoder ( final) {
258
258
zero . optional_field ( field_name , None , zero . optional ( field_decoder ) , next )
259
- // let decoding_function = fn(data: Dynamic) {
260
- // use <- bool.guard(dynamic.classify(data) == "Nil", Ok(None))
261
-
262
- // case zero.run(data, zero.optional(field_decoder)) {
263
- // Ok(None) -> {
264
- // case zero.run(data, field_decoder) {
265
- // Ok(v) -> Ok(Some(v))
266
- // Error(_) -> Ok(None)
267
- // }
268
- // }
269
- // other -> other
270
- // }
271
- // }
272
-
273
- // let decoder = zero.new_primitive_decoder(decoding_function, None)
274
-
275
- // zero.field(field_name, decoder, next)
276
259
}
277
260
278
261
/// Decode a command line option by either a long name or short name
0 commit comments