summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@redhat.com>2021-02-03 21:23:14 -0500
committerShaun McCance <shaunm@redhat.com>2021-02-03 21:23:14 -0500
commite2224eeb4646b013bf25294221728713719d5755 (patch)
treee498196d5c85102bdfe92581d239b4633ca86388
parente1fe3fb6f7a412a281a515f1127f5cc73f851e12 (diff)
downloadyelp-tools-e2224eeb4646b013bf25294221728713719d5755.tar.gz
yelp-check: Use desc if blurb not set on --help for custom checkers
-rwxr-xr-xtools/yelp-check.in3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/yelp-check.in b/tools/yelp-check.in
index 2578800..df8580c 100755
--- a/tools/yelp-check.in
+++ b/tools/yelp-check.in
@@ -243,6 +243,8 @@ class Checker:
#FIXME: prettify names of formats
if self.blurb is not None:
print(self.blurb + '\n')
+ elif self.desc is not None:
+ print(self.desc + '\n')
print('Options:')
maxarglen = 2
args = []
@@ -1126,6 +1128,7 @@ class CustomChecker(Checker):
if self.config is None or (sect not in self.config.sections()):
print('Unrecognized command: ' + self.name, file=sys.stderr)
return 1
+ self.desc = self.config.get(sect, 'desc', fallback=None)
self.blurb = self.config.get(sect, 'blurb', fallback=None)
if self.blurb is not None:
self.blurb = '\n'.join(textwrap.wrap(self.blurb))