strip whitespace from long descriptions just to be safe

This commit is contained in:
Kovid Goyal 2022-08-17 00:00:23 +05:30
parent e356af2dc4
commit d3bb69a0ac
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -19,7 +19,7 @@ def serialize_as_go_string(x: str) -> str:
def build_go_code(name: str, cmd: RemoteCommand, opts: Any, template: str) -> str:
template = template[len('//go:build exclude'):]
ans = template.replace('CMD_NAME', name).replace('__FILE__', __file__).replace('CLI_NAME', name.replace('_', '-')).replace(
'SHORT_DESC', serialize_as_go_string(cmd.short_desc)).replace('LONG_DESC', serialize_as_go_string(cmd.desc))
'SHORT_DESC', serialize_as_go_string(cmd.short_desc)).replace('LONG_DESC', serialize_as_go_string(cmd.desc.strip()))
return ans