I'm curious - why do `path` and `convert` require ...
# clikt
r
I'm curious - why do
path
and
convert
require a
NullableOption
as the receiver, meaning I cannot use
default
before them? I'd quite like to be able to have an option that specifies a file, with a default as a string, so I can then benefit from the validators on
path
, and apply my conversion (which effectively validates the contents of the file and return it in a single pass).
a
It's discussed a bit in the docs. The final option value is calculated by calling
transformAll(transformEach(convert(argv)))
. So you can't call
convert
after
default
(which is a wrapper around
transformAll
), since
transformAll
takes the output of
convert
.