]> arthur.barton.de Git - ax-zsh.git/commitdiff
New core module "99_cleanup"
authorAlexander Barton <alex@barton.de>
Sun, 27 Sep 2015 18:19:51 +0000 (20:19 +0200)
committerAlexander Barton <alex@barton.de>
Sun, 27 Sep 2015 18:19:51 +0000 (20:19 +0200)
Don't pollute the namespace, remove variables/functions/...

core/99_cleanup/99_cleanup.zlogin [new file with mode: 0644]
core/99_cleanup/99_cleanup.zshrc [new file with mode: 0644]

diff --git a/core/99_cleanup/99_cleanup.zlogin b/core/99_cleanup/99_cleanup.zlogin
new file mode 100644 (file)
index 0000000..eb6debc
--- /dev/null
@@ -0,0 +1,21 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# 99_cleanup.zlogin: Don't pollute the namespace, remove variables/functions/...
+
+for func (
+       ax_hostname_prompt_root
+       ax_hostname_prompt_yn
+       ax_logname_prompt_root
+       ax_logname_prompt_yn
+); do
+       unfunction $func
+done
+
+for func ($ax_logname_prompt_functions); do
+       unfunction $func 2>/dev/null
+done
+unset ax_logname_prompt_functions
+
+for func ($ax_hostname_prompt_functions); do
+       unfunction $func 2>/dev/null
+done
+unset ax_hostname_prompt_functions
diff --git a/core/99_cleanup/99_cleanup.zshrc b/core/99_cleanup/99_cleanup.zshrc
new file mode 100644 (file)
index 0000000..eefb842
--- /dev/null
@@ -0,0 +1,6 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# 99_cleanup.zshrc: Don't pollute the namespace, remove variables/functions/...
+
+[[ -o login ]] && return
+
+source "$AXZSH/core/99_cleanup/99_cleanup.zlogin"