HomeFreeBSD

nanobsd: minor formatting cleanup

Description

nanobsd: minor formatting cleanup

  • Reformat function definitions

POSIX states that compound commands, i.e., ones that use (..) or
{ .. } , are permissible as function definitions, however, many shell
syntax validators do not acknowledge the former format.

Switch to the latter format so more naive editors, like the vim syntax
highlighter, better parse the syntax of the file.

Moreover, replacing (..) with {..} replaces several subshells with
their non-subshell equivalents. Given that set -e is used liberally
and exit is not used in the calling code when set -e is not
enforced, there is no net loss by making this change.

  • Clean trailing whitespace.
  • Reindent some related comments to match the indentation of the previous line.
  • Add shebangs to the tops of files to help syntax colorizers and file identifiers understand that the files are in shell syntax.

MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D52596

Details

Provenance
ngieAuthored on Sep 17 2025, 6:06 PM
Differential Revision
D52596: nanobsd: minor formatting cleanup
Parents
rGa37825313f62: stand/man: Fix mdoc typos for emails, tag spdx
Branches
Unknown
Tags
Unknown