1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

Never require login in the help command

This commit is contained in:
Daniel Mach 2022-05-05 11:07:28 +02:00
parent 4aecebc265
commit cc0b8f1606
2 changed files with 7 additions and 0 deletions

View File

@ -326,6 +326,8 @@ class RawCmdln(cmd.Cmd):
if self.optparser: # i.e. optparser=None means don't process for opts
try:
self.options, args = self.optparser.parse_args(argv[1:])
# store args so we can use them in self.postoptparse()
self.args = args
except CmdlnUserError as ex:
msg = "%s: %s\nTry '%s help' for info.\n"\
% (self.name, ex, self.name)

View File

@ -133,6 +133,11 @@ class Osc(cmdln.Cmdln):
def postoptparse(self):
"""merge commandline options into the config"""
if self._get_canonical_cmd_name(self.args[0]) == "help":
# avoid loading config that may trigger prompt for username, password etc.
return
try:
conf.get_config(override_conffile = self.options.conffile,
override_apiurl = self.options.apiurl,