From d66394dc10517af4578e80d626dc903a3cdece79 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sat, 12 Sep 2020 10:40:17 +0200 Subject: Fixing autocompletion with 0 match, Fixing export singleton with --posix --- src/hooks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/hooks.py') diff --git a/src/hooks.py b/src/hooks.py index 770aca8..001b956 100644 --- a/src/hooks.py +++ b/src/hooks.py @@ -6,7 +6,7 @@ # By: charles +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/09/11 16:10:20 by charles #+# #+# # -# Updated: 2020/09/11 22:11:21 by charles ### ########.fr # +# Updated: 2020/09/12 10:37:16 by charles ### ########.fr # # # # ############################################################################ # @@ -38,7 +38,8 @@ def discard(output): def export_singleton(output): """Remove variable that are not set to anything in a call to export without arguments""" + prefix = "export " if ("--posix" in config.REFERENCE_ARGS) else "declare -x " return sort_lines( '\n'.join([line for line in output.split('\n') - if regex.match("^declare -x .+=\".*\"$", line) is not None]) + if regex.match("^{}.+=\".*\"$".format(prefix), line) is not None]) ) -- cgit