Skip to content

Commit e05c2cc

Browse files
authored
Updated the action class hierarchy to have more default metavars. (#13167)
1 parent a69c119 commit e05c2cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utils/build_swift/argparse/actions.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,10 @@ def __init__(self,
7676
dests = dests or dest
7777
if dests == argparse.SUPPRESS:
7878
dests = []
79+
metavar = metavar or ''
7980
elif isinstance(dests, str):
8081
dests = [dests]
82+
metavar = metavar or dests[0].upper()
8183

8284
super(Action, self).__init__(
8385
option_strings=option_strings,
@@ -242,6 +244,7 @@ class StorePathAction(StoreAction):
242244
def __init__(self, option_strings, **kwargs):
243245
kwargs['nargs'] = Nargs.SINGLE
244246
kwargs['type'] = PathType()
247+
kwargs.setdefault('metavar', 'PATH')
245248

246249
super(StorePathAction, self).__init__(
247250
option_strings=option_strings,

0 commit comments

Comments
 (0)