mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-21 22:18:52 +02:00
- added support for config variables in a help text
This commit is contained in:
@@ -141,11 +141,13 @@ class Osc(cmdln.Cmdln):
|
|||||||
doc = doc.rstrip() + '\n' # trim down trailing space
|
doc = doc.rstrip() + '\n' # trim down trailing space
|
||||||
return self._str(doc)
|
return self._str(doc)
|
||||||
|
|
||||||
# overridden from Cmdln in order to use config values in options' help text
|
|
||||||
def _help_preprocess_cmd_option_list(self, help, cmdname=None):
|
# overridden from class Cmdln() to use config variables in help texts
|
||||||
help = cmdln.Cmdln._help_preprocess_cmd_option_list(self, help, cmdname)
|
def _help_preprocess(self, help, cmdname):
|
||||||
|
help = cmdln.Cmdln._help_preprocess(self, help, cmdname)
|
||||||
return help % conf.config
|
return help % conf.config
|
||||||
|
|
||||||
|
|
||||||
def do_init(self, subcmd, opts, project, package=None):
|
def do_init(self, subcmd, opts, project, package=None):
|
||||||
"""${cmd_name}: Initialize a directory as working copy
|
"""${cmd_name}: Initialize a directory as working copy
|
||||||
|
|
||||||
@@ -1210,7 +1212,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if nothing else specified.
|
if nothing else specified.
|
||||||
|
|
||||||
The branched package will come from
|
The branched package will come from
|
||||||
openSUSE:Factory
|
%(branch_project)s
|
||||||
if nothing else specified.
|
if nothing else specified.
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
@@ -1222,8 +1224,6 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# FIXME: how can we interpolate conf.config['branch_project'] in the above message?
|
|
||||||
|
|
||||||
if (subcmd == 'branch_co' or subcmd == 'branchco' or subcmd == 'bco'): opts.checkout = True
|
if (subcmd == 'branch_co' or subcmd == 'branchco' or subcmd == 'bco'): opts.checkout = True
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
tproject = tpackage = None
|
tproject = tpackage = None
|
||||||
|
Reference in New Issue
Block a user