Hi, is there a way to make CliktCommand to treat a...
# clikt
b
Hi, is there a way to make CliktCommand to treat all args as positional (even
-h
)? I'm writing a cli that has an interpreter command which needs to propagate all args, but anything starting wit
-h
(e.g.
-hidon'treallywanthelp
) gets eaten up and produces illegal option error. I'm aware of
--
and it works, but I'm wondering if there's a way to somehow hack CliktCommand to avoid having that (this particular command is hidden and is reserved for internal use anyways).
a
Sure, no need for a hack. Collect unknown options in an argument (https://ajalt.github.io/clikt/options/#unknown-options), and set
helpOptionNames = emptySet()
(https://ajalt.github.io/clikt/documenting/#help-option-customization) to get rid of the
-h
option