1
0
mirror of https://github.com/octoleo/hosts.git synced 2024-12-28 04:05:00 +00:00

Group helper variables and functions in Helpers section.

This commit is contained in:
William Melody 2020-09-11 17:00:32 -07:00
parent 0ce875c210
commit 0201480ffb

24
hosts
View File

@ -71,17 +71,6 @@ HOSTS_DEFAULT_SUBCOMMAND="${HOSTS_DEFAULT_SUBCOMMAND:-list}"
# The path to the hosts file. This will almost always be /etc/hosts
HOSTS_PATH="${HOSTS_PATH:-/etc/hosts}"
# Space and tab for regular expressions
#
# sed regular expressions have slightly different behaviors dependending on
# the environment, and POSIX [[:space:]] matches whitespace characters other
# than just space and tab. These variables provide an easier, portable way to
# test for just these two characters.
export _TAB_=$'\t'
export _SPACE_=$' '
export _TAB_SPACE_="${_TAB_}${_SPACE_}"
export _TAB_SPACE_CC_="[${_TAB_SPACE_}]"
# $_REPO
#
# The <user>/<repo> identifier for the git repository.
@ -173,9 +162,20 @@ _warn() {
}
###############################################################################
# Utility Functions
# Helpers
###############################################################################
# Space and tab for regular expressions
#
# sed regular expressions have slightly different behaviors dependending on
# the environment, and POSIX [[:space:]] matches whitespace characters other
# than just space and tab. These variables provide an easier, portable way to
# test for just these two characters.
export _TAB_=$'\t'
export _SPACE_=$' '
export _TAB_SPACE_="${_TAB_}${_SPACE_}"
export _TAB_SPACE_CC_="[${_TAB_SPACE_}]"
# _contains()
#
# Usage: