Closed pawamoy closed 1 hour ago
Hmm, actually cappa.parse
also accepts a HelpFormatable
, and in fact HelpFormatter.__call__
matches the expected signature. So I'm not sure what's wrong here and why I'm not seeing any change in the default format :thinking:
In cappa.base.collect
, this line:
command: Command[T] = Command.get(obj, help_formatter=help_formatter)
...seems to return obj.__cappa__
, which has the default help formatter attached.
OK so I'm probably supposed to pass the help formatter to each @cappa.command
decorator :thinking:
you should be able to do either, it was just early returning in cases where the command was already decorated with @command
and failing to apply the help_formatter option.
The docs lead me to think I could do this:
...but the default value format is left unchanged.
Looking at
cappa.invoke
's signature,help_formatter
accetps aHelpFormatable
there, which is callable accepting aCommand
and a string and return a list ofDisplayable
.Is it expected that
cappa.invoke
andcappa.parse
handle thehelp_formatter
argument differently?