mirror of
https://github.com/eth-p/bat-extras.git
synced 2024-12-13 01:30:58 +01:00
Update batwatch to use print_error function
This commit is contained in:
parent
80a07980aa
commit
767cfb59b0
@ -209,18 +209,18 @@ fi
|
|||||||
if [[ -z "$OPT_WATCHER" ]]; then
|
if [[ -z "$OPT_WATCHER" ]]; then
|
||||||
OPT_WATCHER="$(determine_watcher)"
|
OPT_WATCHER="$(determine_watcher)"
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
printc "%{RED}[%s error]%{CLEAR}: Your system does not have any supported watchers.\n" "$PROGRAM" 1>&2
|
print_error "Your system does not have any supported watchers."
|
||||||
printc "Please read the documentation at %{BLUE}%s%{CLEAR} for more details.\n" "$DOCS_URL/batwatch.md" 1>&2
|
printc "Please read the documentation at %{BLUE}%s%{CLEAR} for more details.\n" "$DOCS_URL/batwatch.md" 1>&2
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if ! type "watcher_${OPT_WATCHER}_supported" &>/dev/null; then
|
if ! type "watcher_${OPT_WATCHER}_supported" &>/dev/null; then
|
||||||
printc "%{RED}[%s error]%{CLEAR}: Unknown watcher: '%s'\n" "$PROGRAM" "$OPT_WATCHER" 1>&2
|
print_error "Unknown watcher: '%s'" "$OPT_WATCHER"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! "watcher_${OPT_WATCHER}_supported" &>/dev/null; then
|
if ! "watcher_${OPT_WATCHER}_supported" &>/dev/null; then
|
||||||
printc "%{RED}[%s error]%{CLEAR}: Unsupported watcher: '%s'\n" "$PROGRAM" "$OPT_WATCHER" 1>&2
|
print_error "Unsupported watcher: '%s'" "$OPT_WATCHER"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user