From 4d554fb634b4f4c16bc5912af697476595326986 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 25 Mar 2021 09:18:54 +0100 Subject: bin/nit-picker: -x new --- bin/nit-picker | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/nit-picker b/bin/nit-picker index d313586..3fb558e 100755 --- a/bin/nit-picker +++ b/bin/nit-picker @@ -19,14 +19,16 @@ # shellcheck disable=SC2016 print_usage() { - >&2 echo 'usage: nit-picker [-n|-r] [$single_test]' + >&2 echo 'usage: nit-picker [-n|-r|-x] [$single_test]' >&2 echo ' -n: Do not join irc.' >&2 echo ' -r: Remove superfluid dependencies in the database.' >&2 echo ' To avoid catastrophic breakage, this option requires' >&2 echo ' $single_test being set.' + >&2 echo ' -x: Exit upon first found inconsistency.' >&2 echo ' $single_test: Only execute the given test.' } +exit_fast=false irc=true repair_dependencies=false @@ -40,6 +42,10 @@ while [ $# -ge 1 ]; do >&2 echo 'repair all wrong dependencies (remove superfluid, add missing)' repair_dependencies=true ;; + '-x') + >&2 echo 'exit, when the first inconsistency is being found' + exit_fast=true + ;; '-*') >&2 printf 'unknown option "%s"\n' "$1" print_usage @@ -125,6 +131,9 @@ local_irc_say() { else sed 's/^/irc: /' fi + if ${exit_fast}; then + exit 1 + fi if ! ${single_run}; then sleep 60 fi -- cgit v1.2.3-70-g09d2