]> git.tue.mpg.de Git - gsu.git/commitdiff
gui: Make _gsu_node_name_pattern private.
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 1 Sep 2014 21:58:29 +0000 (23:58 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 27 Sep 2014 23:02:00 +0000 (23:02 +0000)
Conform to the convention that the name of a private variables should
start with an underscore character. Also there is no need to export
the variable.

gui

diff --git a/gui b/gui
index b0d70075f15a02a1702a33bdcc8660096abd6b20..db81f7fd1c308d84cc6691791de13b248bc2e305 100644 (file)
--- a/gui
+++ b/gui
@@ -6,7 +6,7 @@ if [[ "$(type -t _gsu_setup)" != "function" ]]; then
        _gsu_setup
 fi
 
-export GSU_NODE_NAME_PATTERN='[a-zA-Z_]'
+_gsu_node_name_pattern='[a-zA-Z_]'
 
 _get_geometry()
 {
@@ -72,7 +72,7 @@ _gsu_menu()
 
 _get_level()
 {
-       local tmp="${1%%$GSU_NODE_NAME_PATTERN*}"
+       local tmp="${1%%$_gsu_node_name_pattern*}"
        result="${#tmp}"
 }
 
@@ -90,7 +90,7 @@ _get_subtree()
 
        #echo "line: $line_num, root: $root, indent level: $level"
        result="$(sed -e "1,${line_num}d;" <<< "$tree" \
-               | sed -e "/^$TAB\{1,$level\}$GSU_NODE_NAME_PATTERN/,\$d" \
+               | sed -e "/^$TAB\{1,$level\}$_gsu_node_name_pattern/,\$d" \
                | sed -e "/^$TAB\{$(($level + 2))\}/d")"
        ret="$level"
 }
@@ -99,7 +99,7 @@ _get_root_nodes()
 {
        local tree="$1" TAB='   '
 
-       result="$(grep "^${TAB}${GSU_NODE_NAME_PATTERN}" <<< "$tree")"
+       result="$(grep "^${TAB}${_gsu_node_name_pattern}" <<< "$tree")"
 }
 
 _browse()