mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-26 01:46: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:
commit
560bd953e0
@ -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