From 1ad72842b3dcf10cc89cd682a044f4780ac97e41 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Fri, 11 Sep 2020 18:32:57 +0200 Subject: Added export alone, quote missing and tab in cmd test --- src/hooks.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/hooks.py') diff --git a/src/hooks.py b/src/hooks.py index b723b99..7ee1334 100644 --- a/src/hooks.py +++ b/src/hooks.py @@ -6,16 +6,19 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/11 16:10:20 by charles #+# #+# # -# Updated: 2020/09/11 17:06:03 by charles ### ########.fr # +# Updated: 2020/09/11 18:26:58 by charles ### ########.fr # # # # ############################################################################ # +import regex + import config def sort_lines(output): return '\n'.join(sorted(output.split('\n'))) + def error_line0(output): lines = output.split('\n') if len(lines) != 3: @@ -25,5 +28,13 @@ def error_line0(output): return output return lines[0].replace(prefix, "minishell: ") + "\n" + def discard(output): return "DISCARDED BY TEST" + + +def export_singleton(output): + return sort_lines( + '\n'.join([l for l in output.split('\n') + if regex.match("^declare -x .+=\".*\"$", l) is not None]) + ) -- cgit