From 8155250bcdce4737a0fdb1d3009d9878f61ee324 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 24 Nov 2012 21:21:56 -0500 Subject: handle deprecation notices in -H and -L Separate out the printing from these flags to separate functions and examine each hook more closely, pointing out where it might be deprecated, and what should be used in place of it. Signed-off-by: Dave Reisner --- functions | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'functions') diff --git a/functions b/functions index f46a9ae..10a072c 100644 --- a/functions +++ b/functions @@ -193,6 +193,18 @@ in_array() { return 1 # Not Found } +index_of() { + # get the array index of an item. size limit of 254 items! + local item=$1; shift + + for (( i=1; i <= $#; i++ )); do + [[ $item = ${!i} ]] && return $(( --i )) + done + + # not found + return 255 +} + funcgrep() { awk -v funcmatch="$1" ' /^[[:space:]]*[[:alnum:]_]+[[:space:]]*\([[:space:]]*\)/ { -- cgit v1.2.3-24-g4f1b