From ce3fe9aefcd3c79fe87085e62684fa7d2d9bb9f2 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 1 Sep 2014 23:58:29 +0200 Subject: [PATCH] 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. --- gui | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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() -- 2.30.2