mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-06-20 19:57:46 +02:00
Update batwatch to show errors outside the pager
This commit is contained in:
parent
a63609e173
commit
33ebf07bbd
@ -124,21 +124,23 @@ fi
|
||||
# -----------------------------------------------------------------------------
|
||||
# Main:
|
||||
# -----------------------------------------------------------------------------
|
||||
main() {
|
||||
# Determine the watcher.
|
||||
if [[ -z "$OPT_WATCHER" ]]; then
|
||||
OPT_WATCHER="$(determine_watcher)"
|
||||
if [[ $? -ne 0 ]]; then
|
||||
printc "%{RED}[%s error]%{CLEAR}: Your system does not have any supported watchers.\n" "$PROGRAM" 1>&2
|
||||
printc "Please read the documentation at {BLUE}%s%{CLEAR} for more details.\n" "$DOCS_URL/batwatch.md" 1>&2
|
||||
return 2
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! type "watcher_${OPT_WATCHER}_supported" &>/dev/null; then
|
||||
printc "%{RED}[%s error]%{CLEAR}: Unknown watcher: '%s'\n" "$PROGRAM" "$OPT_WATCHER" 1>&2
|
||||
return 1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Run the main function.
|
||||
main() {
|
||||
"watcher_${OPT_WATCHER}_watch" "${FILES[@]}"
|
||||
return $?
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user