mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 17:16:23 +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
|
if self.optparser: # i.e. optparser=None means don't process for opts
|
||||||
try:
|
try:
|
||||||
self.options, args = self.optparser.parse_args(argv[1:])
|
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:
|
except CmdlnUserError as ex:
|
||||||
msg = "%s: %s\nTry '%s help' for info.\n"\
|
msg = "%s: %s\nTry '%s help' for info.\n"\
|
||||||
% (self.name, ex, self.name)
|
% (self.name, ex, self.name)
|
||||||
|
@ -133,6 +133,11 @@ class Osc(cmdln.Cmdln):
|
|||||||
|
|
||||||
def postoptparse(self):
|
def postoptparse(self):
|
||||||
"""merge commandline options into the config"""
|
"""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:
|
try:
|
||||||
conf.get_config(override_conffile = self.options.conffile,
|
conf.get_config(override_conffile = self.options.conffile,
|
||||||
override_apiurl = self.options.apiurl,
|
override_apiurl = self.options.apiurl,
|
||||||
|
Loading…
Reference in New Issue
Block a user