[cmd_exclude][cmd_include] Will now output the number of matches for condition

This commit is contained in:
ayakael 2018-04-08 13:02:18 -04:00
parent 1960232553
commit 9ab2fec0f1
No known key found for this signature in database
GPG key ID: 575626A4AE5F4026
2 changed files with 6 additions and 4 deletions

View file

@ -25,8 +25,9 @@ cmd_exclude() {
for condition in ${conditionList[@]}; do
_msg EXEC "Excluding all tracks that match the following condition: ${condition}"
db_set ${GIT_DIR} ${DB_FILE} false "${condition}"
[[ $? -ne 0 ]] && { _msg WARN; } || { _msg OK; }
local MATCHES=$(db_set ${GIT_DIR} ${DB_FILE} false "${condition}" 2>${STDERR} | wc -l )
_msg ECHO "${MATCHES} matches"
[[ $? -ne 0 ]] && { _msg WARN 2; } || { _msg OK 2; }
done
local imageidList=($(awk 'BEGIN{FS="\t"}{if($1=="true"){print $2}}' ${DB_FILE} | awk '!seen[$0]++'))
local DU="$(print_imageid_du ${GIT_DIR} ${imageidList[@]})"

View file

@ -25,8 +25,9 @@ cmd_include() {
for condition in ${conditionList[@]}; do
_msg EXEC "Including all tracks that match the following condition: ${condition}"
db_set ${GIT_DIR} ${DB_FILE} true "${condition}"
[[ $? -ne 0 ]] && { _msg WARN; } || { _msg OK; }
local MATCHES=$(db_set ${GIT_DIR} ${DB_FILE} true "${condition}" | wc -l)
_msg ECHO "${MATCHES} matches"
[[ $? -ne 0 ]] && { _msg WARN 1; } || { _msg OK 1; }
done
local imageidList=($(awk 'BEGIN{FS="\t"}{if($1=="true"){print $2}}' ${DB_FILE} | awk '!seen[$0]++'))
local DU="$(print_imageid_du ${GIT_DIR} ${imageidList[@]})"