andrey-zherikov / argparse

Parser for command-line arguments
https://andrey-zherikov.github.io/argparse/
Boost Software License 1.0
30 stars 6 forks source link

`errorHandler` is unusable #118

Closed SirNickolas closed 8 months ago

SirNickolas commented 9 months ago
import argparse;

struct Args {
    bool banana;
}

mixin CLI!({
    Config cfg;
    cfg.errorHandler = (string) { };
    return cfg;
}(), Args).main!((in _) { });
argparse/config.d(90,9): Error: closures are not yet supported in CTFE

N.B. (string) { } is not a closure; return errorHandlerFunc = (string msg) { func(msg); }; (inside the library) is.