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:
parent
4aecebc265
commit
cc0b8f1606
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user