| 1 | #!/usr/bin/python3 |
| 2 | |
| 3 | # ...until #embed comes along... |
| 4 | # eg: tools/escape-to-c cockpit_webresponse_fail_html_text < fail.html > fail.html.c |
| 5 | |
| 6 | import json |
| 7 | import sys |
| 8 | |
| 9 | # Use a pointer to allow overriding the value |
| 10 | print('const char *', sys.argv[1], '=\n', |
| 11 | *[json.dumps(line) + '\n' for line in sys.stdin], |
| 12 | ';') |