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

Remove unused utility functions.

This commit is contained in:
William Melody 2020-06-07 13:39:01 -07:00
parent 1e6af9b309
commit 2b81ea530f

30
hosts
View File

@ -268,36 +268,6 @@ _main() {
# Utility Functions
###############################################################################
# _function_exists()
#
# Usage:
# _function_exists "possible_function_name"
#
# Exit Status:
# 0 If a function with the given name is defined in the current environment.
# 1 If not.
#
# Other implementations, some with better performance:
# http://stackoverflow.com/q/85880
_function_exists() {
[ "$(type -t "${1}")" == 'function' ]
}
# _command_exists()
#
# Usage:
# _command_exists "possible_command_name"
#
# Exit Status:
# 0 If a command with the given name is defined in the current environment.
# 1 If not.
#
# Information on why `hash` is used here:
# http://stackoverflow.com/a/677212
_command_exists() {
hash "${1}" 2>/dev/null
}
# _contains()
#
# Usage: