Skip to content
Myr

Argument.make_metavar() defaults to type metavar

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fixes Argument.make_metavar() to respect the default metavar set by a custom type ahead of defaulting to Argument.name Fixes #674

authored by Stephen Rosen · committed by Stephen Rosen · parent d3f36e8 · Browse files · 1 file+3 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−1 removed

  • other:+3 added−1 removed

1 file+3 added−1 removed

modified:click/core.py+3 added-1 removed
1717 unmodified lines
17181719 def make_metavar(self):1720 if self.metavar is not None:1721 return self.metavar1722 var = self.type.get_metavar(self)1723 if not var:1722 var = self.name.upper()1724 var = self.name.upper()1725 if not self.required:1726 var = '[%s]' % var1727 if self.nargs != 1:1728 var += '...'
27 unmodified lines