${FX_ITALIC}--skip-ok${FX_RESET} ${FX_BOLD}Don't display anything for files that do not exist (default)${FX_RESET}
+ ${FX_ITALIC}--skip-unsupported${FX_RESET} ${FX_BOLD}Don't display anything for files that do not have fixes available${FX_RESET}
+
"""
printf "%b" "$HELPSTRING"
}
SKIP_OK=true
+SKIP_UNSUPPORTED=false
for i in "$@"; do
if [ "$i" = "--help" ] || [ "$i" = "-h" ]; then
help
SKIP_OK=true
elif [ "$i" = "--no-skip-ok" ]; then
SKIP_OK=false
+ elif [ "$i" = "--skip-unsupported" ]; then
+ SKIP_UNSUPPORTED=true
elif [ "$i" = "-v" ]; then
SKIP_OK=false
fi
/' # Replace \n with literal newline and \" with ", normalize number of trailing newlines to 2
}
+# Counter to keep track of how many files can be moved
+FIXABLE=0
+
# Function to handle the formatting of output
log() {
MODE="$1"
ERR)
printf '[%b%s%b]: %b%s%b\n' "${FX_BOLD}${FG_RED}" "$NAME" "${FX_RESET}" "${FX_BOLD}${FX_ITALIC}" "$FILENAME" "${FX_RESET}"
+ FIXABLE=$((FIXABLE+1))
;;
WARN)
- printf '[%b%s%b]: %b%s%b\n' "${FX_BOLD}${FG_YELLOW}" "$NAME" "${FX_RESET}" "${FX_BOLD}${FX_ITALIC}" "$FILENAME" "${FX_RESET}"
+ [ "$SKIP_UNSUPPORTED" = false ] &&
+ printf '[%b%s%b]: %b%s%b\n' "${FX_BOLD}${FG_YELLOW}" "$NAME" "${FX_RESET}" "${FX_BOLD}${FX_ITALIC}" "$FILENAME" "${FX_RESET}"
;;
INFO)
log WARN "$NAME" "$FILENAME" "$HELP"
fi
if [ "$HELP" ]; then
- log HELP "$NAME" "$FILENAME" "$HELP"
+ if [ "$MOVABLE" = true ] || [ "$SKIP_UNSUPPORTED" = false ]; then
+ log HELP "$NAME" "$FILENAME" "$HELP"
+ fi
else
log HELP "$NAME" "$FILENAME" "_No help available._"
fi
printf "\n"
}
-
check_programs
+if [ $FIXABLE -gt 100 ]; then
+ exit 101
+else
+ exit $FIXABLE
+fi