Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape backslashes in docstrings #360

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/aaz_dev/cli/templates/aaz/command/_cmd.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class {{ leaf.cls_name }}(
AAZCommand
{%- endif -%}
):
"""{{ leaf.help.short }}
"""{{ leaf.help.short|replace('\\', '\\\\') }}
{%- if leaf.help.long is not none and leaf.help.long|length %}

{{ leaf.help.long.split('\n')|join('\n ') }}
{{ leaf.help.long.split('\n')|join('\n ')|replace('\\', '\\\\') }}
{%- endif %}
{%- if leaf.help.examples is not none and leaf.help.examples|length %}
{%- for example in leaf.help.examples %}
Expand Down
4 changes: 2 additions & 2 deletions src/aaz_dev/cli/templates/aaz/group/__cmd_group.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ from azure.cli.core.aaz import *
)
{%- endif %}
class __CMDGroup(AAZCommandGroup):
"""{{ node.help.short }}
"""{{ node.help.short|replace('\\', '\\\\') }}
{%- if node.help.long is not none and node.help.long|length %}

{{ node.help.long.split('\n')|join('\n ') }}
{{ node.help.long.split('\n')|join('\n ')|replace('\\', '\\\\') }}
{%- endif %}
"""
pass
Expand Down
Loading