aboutsummaryrefslogtreecommitdiff
path: root/src/hooks.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hooks.py')
-rw-r--r--src/hooks.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/hooks.py b/src/hooks.py
index 7582c6e..770aca8 100644
--- a/src/hooks.py
+++ b/src/hooks.py
@@ -6,7 +6,7 @@
# By: charles <me@cacharle.xyz> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/09/11 16:10:20 by charles #+# #+# #
-# Updated: 2020/09/11 19:53:43 by charles ### ########.fr #
+# Updated: 2020/09/11 22:11:21 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -16,10 +16,12 @@ import config
def sort_lines(output):
+ """Sort lines of output"""
return '\n'.join(sorted(output.split('\n')))
def error_line0(output):
+ """Replace "/bin/bash: -c: line 0:" by "minishell:" and delete the second line"""
lines = output.split('\n')
if len(lines) != 3:
return output
@@ -30,10 +32,12 @@ def error_line0(output):
def discard(output):
+ """Discard the output"""
return "DISCARDED BY TEST"
def export_singleton(output):
+ """Remove variable that are not set to anything in a call to export without arguments"""
return sort_lines(
'\n'.join([line for line in output.split('\n')
if regex.match("^declare -x .+=\".*\"$", line) is not None])