|
1 | 1 | import os |
2 | 2 | from os.path import join |
3 | 3 | from functools import wraps |
4 | | -from color import error, warning, success |
| 4 | +from color import error, warning, success, Styles, modify_words |
5 | 5 | from difflib import SequenceMatcher |
6 | 6 | import sys |
7 | 7 |
|
@@ -101,9 +101,9 @@ def call(cls, cmd, jobname): |
101 | 101 | @app.command("release", "dev") |
102 | 102 | def build(app, job = None): |
103 | 103 | """Builds the docs. |
104 | | - * Increases the project version if 'release' argument is given. |
105 | | - * Opens the docs/index.html in browser if 'dev' argument is given. |
106 | | - * Moves them to where they are needed if 'release' or 'dev' argument is given.""" |
| 104 | + * Increases the project version if [release] argument is given. |
| 105 | + * Opens the docs/index.html in browser if [dev] argument is given. |
| 106 | + * Moves them to where they are needed if [release] or [dev] argument is given.""" |
107 | 107 |
|
108 | 108 | # should we do that at the start so that it affects this release or at the end so that it doesn't run if there is an exception? |
109 | 109 | if job == "release": |
@@ -166,11 +166,11 @@ def version(app, field): |
166 | 166 | def help(app, method = None): |
167 | 167 | "Displays a help message for the given argument." |
168 | 168 | if method is None: |
169 | | - print("Possible arguments for the application:\n") |
| 169 | + print("Valid arguments for the application:\n") |
170 | 170 | for i in app.procedures: |
171 | | - print(f"- {i:<20}" + app.procedures[i][0].__doc__) |
| 171 | + print(f"- {i:<20}" + modify_words(app.procedures[i][0].__doc__, words = tuple(map(lambda x: f"[{x}]", app.procedures[i][1])), style = Styles.BOLD, replacement_rule = lambda x: x[1:-1])) |
172 | 172 | else: |
173 | | - print(f"{method}:", app.procedures[method][0].__doc__) |
| 173 | + print(f"{method}:", modify_words(app.procedures[method][0].__doc__, words = tuple(map(lambda x: f"[{x}]", app.procedures[method][1])), style = Styles.BOLD, replacement_rule = lambda x: x[1:-1])) |
174 | 174 |
|
175 | 175 | if __name__ == "__main__": |
176 | 176 | import sys |
|
0 commit comments