1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-26 18:06:13 +01:00

Merge pull request #1035 from dmach/fix/do-not-require-login-in-help

Never require login in the help command
This commit is contained in:
Marco Strigl 2022-05-12 10:48:10 +02:00 committed by GitHub
commit 560bd953e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,