Skip to main content

debug/README.md

1# debug
3This is a collection of scripts that use [ANSI escape codes](https://stackoverflow.com/a/5947802/1558022) to print coloured messages to the terminal.
5I have them saved as individual shell scripts so I can call them from any of my other scripts.
7## The individual scripts
9<!-- [[[cog
11# This adds the root of the repo to the PATH, which has cog_helpers.py
12from os.path import abspath, dirname
13import sys
15sys.path.append(abspath(dirname(dirname("."))))
17import cog_helpers
19folder_name = "debug"
21scripts = [
22 {
23 "usage": "print_error [MESSAGE]",
24 "description": """
25 print an error message in red and to stdout
26 """
27 },
28 {
29 "usage": "print_info [MESSAGE]",
30 "description": """
31 print an info message in blue
32 """
33 },
34 {
35 "usage": "print_success [MESSAGE]",
36 "description": """
37 print a success message in green
38 """
39 },
40 {
41 "usage": "print_warning [MESSAGE]",
42 "description": """
43 print a warning message in yellow
44 """
45 },
48cog_helpers.create_description_table(folder_name=folder_name, scripts=scripts)
50]]]-->
51<dl>
52 <dt>
53 <a href="https://github.com/alexwlchan/scripts/blob/main/debug/print_error">
54 <code>print_error [MESSAGE]</code>
55 </a>
56 </dt>
57 <dd>
58 print an error message in red and to stdout
59 </dd>
61 <dt>
62 <a href="https://github.com/alexwlchan/scripts/blob/main/debug/print_info">
63 <code>print_info [MESSAGE]</code>
64 </a>
65 </dt>
66 <dd>
67 print an info message in blue
68 </dd>
70 <dt>
71 <a href="https://github.com/alexwlchan/scripts/blob/main/debug/print_success">
72 <code>print_success [MESSAGE]</code>
73 </a>
74 </dt>
75 <dd>
76 print a success message in green
77 </dd>
79 <dt>
80 <a href="https://github.com/alexwlchan/scripts/blob/main/debug/print_warning">
81 <code>print_warning [MESSAGE]</code>
82 </a>
83 </dt>
84 <dd>
85 print a warning message in yellow
86 </dd>
87</dl>
88<!-- [[[end]]] (sum: b8iS/LTHw2) -->