diff options
author | Shaun McCance <shaunm@redhat.com> | 2021-02-03 21:23:14 -0500 |
---|---|---|
committer | Shaun McCance <shaunm@redhat.com> | 2021-02-03 21:23:14 -0500 |
commit | e2224eeb4646b013bf25294221728713719d5755 (patch) | |
tree | e498196d5c85102bdfe92581d239b4633ca86388 | |
parent | e1fe3fb6f7a412a281a515f1127f5cc73f851e12 (diff) | |
download | yelp-tools-e2224eeb4646b013bf25294221728713719d5755.tar.gz |
yelp-check: Use desc if blurb not set on --help for custom checkers
-rwxr-xr-x | tools/yelp-check.in | 3 |
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)) |