fix the example script in maintain/style

Signed-off-by: Leah Rowe <leah@libreboot.org>
master
Leah Rowe 2023-09-15 07:42:44 +01:00
parent 8fde7f2445
commit fb08e2fb93
1 changed files with 9 additions and 3 deletions

View File

@ -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 $@