Create utils.py
Browse files
utils.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
def format_bash_command(tokens):
|
2 |
+
formatted_command = []
|
3 |
+
indent = " " * 4
|
4 |
+
for token in tokens:
|
5 |
+
if token.startswith("-"):
|
6 |
+
formatted_command.append("\n" + indent + token)
|
7 |
+
else:
|
8 |
+
formatted_command.append(" " + token)
|
9 |
+
return "".join(formatted_command)
|