App: Support --verbose

Add the --verbose global option, which is made available as the
App.verbose property.

Some functions still take a verbose parameter, but the type of these
parameters is converted from bool to bool|None.  The idea is that, if
they are None, their verbosity falls back to the global default.

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-03-06 16:50:27 +01:00
commit 67a2931f5e
5 changed files with 28 additions and 11 deletions

View file

@ -82,7 +82,9 @@ class Distro(abc.ABC):
async def _reboot_required(self, verbose: bool) -> bool:
pass
async def reboot_required(self, verbose: bool=False) -> bool:
async def reboot_required(self, verbose: bool|None=None) -> bool:
if verbose is None:
verbose = self.ctx.verbose_default
return await self._reboot_required(verbose=verbose)
# -- select