chiark / gitweb /
make-secnet-sites: Provide ArgActionLambda
optparse has a helpful lambda facility, so you can pass a lambda
directly to add_argument. But optparse is deprecated so we are using
argparse, in which this facility was unaccountably removed.
Instead you have to subclass argparse.Action.
The resulting ArgActionLambda will still be a bit awkward to use but a
lot better than lifting what ought to be each lambda body into its own
subclass.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>