If you do the following, you get bad behavior:
class MyType(click.ParamType):
def get_metavar(self, param):
return "MY_TYPE"
@click.command("foo")
@click.help_option()
@click.argument("param", type=MyType())
def foo_command(param):
pass
foo --help produces a metavar of PARAM instead of the more logically correct MY_TYPE.
This is because Argument.make_metavar never looks at self.type.get_metavar(self).
Either this should be fixed so that Argument.make_metavar uses the type metavar by default, or Argument.make_metavar should take a parameter that lets you toggle between the default "name" metavar and the type's default metavar.
If you do the following, you get bad behavior:
foo --helpproduces a metavar ofPARAMinstead of the more logically correctMY_TYPE.This is because
Argument.make_metavarnever looks atself.type.get_metavar(self).Either this should be fixed so that
Argument.make_metavaruses the type metavar by default, orArgument.make_metavarshould take a parameter that lets you toggle between the default "name" metavar and the type's default metavar.