diff --git a/config.sh b/config.sh index c9ce526..31e9f89 100755 --- a/config.sh +++ b/config.sh @@ -28,7 +28,7 @@ function _configure() { # The Argyments passed to the find command ETOOLS_FIND_ARGS=${ETOOLS_FIND_ARGS:-''' --exclude profiles --exclude scripts --exclude eclass --exclude metadata - --exclude dev-perl --exclude dev-ml + --exclude dev-perl --exclude dev-ml --exclude app-doc --exclude app-emacs --exclude dev-ruby --exclude acct-user --exclude acct-group --type directory --format '"\"{}\""' --max-depth 3 --case-sensitive'''} diff --git a/etools.conf b/etools.conf new file mode 100755 index 0000000..d77db4b --- /dev/null +++ b/etools.conf @@ -0,0 +1,23 @@ +#!/bin/bash +# shellcheck disable=SC2034 + +declare -Ag package_weights +package_weights["-bin"]=-10 +package_weights["dev-cpp"]=-3 +package_weights["dev-python"]=-5 +package_weights["dev-haskell"]=-15 +package_weights["gnustep-base"]=-5 + +ETOOLS_DEBUG=false + + +# function etools_find_sort_custom() { +# for package in "${!_etools_packages[@]}"; do +# if [[ $package =~ -bin ]]; then +# _etools_packages["$package"]=$((_etools_packages["$package"] - 30)) +# fi +# done +# } + + +# vim: filetype=sh diff --git a/helper.sh b/helper.sh index 27e2d0b..945c449 100755 --- a/helper.sh +++ b/helper.sh @@ -76,17 +76,19 @@ function _get_high() { } function _most_probable() { - # echo $* - # echo $# - # echo $1 - # echo $2 - (( $# == 2 )) && echo "$2" && return 0; + (( $# == 2 )) && echo "${2//\"/}" && return 0; + + # TODO: maybe don't just test trailing match, but rather excact package name first + # eg.: dev-util/devhelp < example/help for package in "${@:2}"; do # echo "$package" if [[ ${package//\"/} == *"$1" ]]; then echo "${package//\"/}" && return 0; fi done + + # INFO: at this point we're lucky guessing + echo "${2//\"/}" } function _default_sort() {