From fb08e2fb9394d93e6205a788f101de36a2d72e22 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Fri, 15 Sep 2023 07:42:44 +0100 Subject: [PATCH] fix the example script in maintain/style Signed-off-by: Leah Rowe --- site/docs/maintain/style.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/site/docs/maintain/style.md b/site/docs/maintain/style.md index 1324fac..c043042 100644 --- a/site/docs/maintain/style.md +++ b/site/docs/maintain/style.md @@ -68,30 +68,36 @@ attention to how the functions are formatted, e.g. where `{` and `}` go: main() { - + foo + bar + do_something_else } foo() { printf "I'm a function that does stuff.\n" - bar + bar || err "foo: an error occured" do_something_else } bar() { printf "I'm another function that does stuff.\n" + some_other_command || printf "WARNING: bar: something something" 1>&2 } do_something_else() { - complicated_function bla bla bla + complicated_function bla bla bla || \ + err "do_something_else: something happened that wasn't nice" } complicated_function() { printf "I'm a complicated function, provided as helper" printf " function for do_something_else()\n" + + do_some_complicated_stuff || return 1 } main $@