create_manpage_completions.py: add .SH and .UN sections in Type2ManParser

This improves some generated completions, for example:

	diff -u completions.old/g3topbm.fish completions.new/g3topbm.fish
	+complete -c g3topbm -o stop_error -d 'This option tells g3topbm to fail when it finds a problem in the input'
	-complete -c g3topbm -o stop_error
This commit is contained in:
MaxVerevkin 2020-07-09 23:22:58 +03:00 committed by Johannes Altmanninger
parent 23c78a74e4
commit d3661b3808

View File

@ -392,7 +392,7 @@ class Type2ManParser(ManParser):
options_section_regex = re.compile("\.SH OPTIONS(.*?)(\.SH|\Z)", re.DOTALL)
options_section = re.search(options_section_regex, manpage).group(1)
options_parts_regex = re.compile("\.[IT]P( \d+(\.\d)?i?)?(.*?)\.([IT]P|UNINDENT)", re.DOTALL)
options_parts_regex = re.compile("\.[IT]P( \d+(\.\d)?i?)?(.*?)\.([IT]P|UNINDENT|UN|SH)", re.DOTALL)
options_matched = re.search(options_parts_regex, options_section)
add_diagnostic("Command is %r" % CMDNAME)