changeset 497:eb42828c0cbf

Use the new output routinges for errors in fzfs' global error handling
author Franz Glasner <fzglas.hg@dom66.de>
date Fri, 30 Aug 2024 16:48:24 +0200
parents 8af33277a2dd
children 46406503a635
files sbin/fzfs
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/sbin/fzfs	Fri Aug 30 16:44:23 2024 +0200
+++ b/sbin/fzfs	Fri Aug 30 16:48:24 2024 +0200
@@ -516,8 +516,7 @@
             exit 2;
             ;;
         *)
-            echo "ERROR: option handling failed" 1>&2
-            exit 2
+            fatal 2 "option handling failed" 1>&2
             ;;
     esac
 done
@@ -528,7 +527,7 @@
 shift $((OPTIND-1))
 OPTIND=1
 
-test $# -gt 0 || { echo "ERROR: no command given" 1>&2; exit 2; }
+test $# -gt 0 || fatal 2 "no command given"
 
 command="$1"
 shift
@@ -547,7 +546,6 @@
         command_create_tree "$@"
         ;;
     *)
-        echo "ERROR: unknown command \`${command}'" 1>&2
-        exit 2
+        fatal 2 "unknown command \`${command}'" 1>&2
         ;;
 esac