fix the error when mix-use the cache-show and help option

This commit is contained in:
markshao 2022-12-24 11:28:55 +08:00
parent b31db4809b
commit d044e9f642
1 changed files with 7 additions and 1 deletions

View File

@ -1074,6 +1074,12 @@ class Config:
) )
raise raise
except PrintHelp:
self._parser._getparser().print_help()
sys.stdout.write(
"\nNOTE: displaying only minimal help due to UsageError.\n\n"
)
raise UsageError
return self return self
@ -1368,7 +1374,7 @@ class Config:
self.args = args self.args = args
self.args_source = source self.args_source = source
except PrintHelp: except PrintHelp:
pass raise
def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None: def issue_config_time_warning(self, warning: Warning, stacklevel: int) -> None:
"""Issue and handle a warning during the "configure" stage. """Issue and handle a warning during the "configure" stage.