From: Andre Noll Date: Mon, 1 Sep 2014 21:58:29 +0000 (+0200) Subject: gui: Make _gsu_node_name_pattern private. X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=ce3fe9aefcd3c79fe87085e62684fa7d2d9bb9f2;p=gsu.git gui: Make _gsu_node_name_pattern private. 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. --- diff --git a/gui b/gui index b0d7007..db81f7f 100644 --- 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()