jw-pkg/src/python/jw/pkg/cmds/distro/CmdRebootRequired.py

18 lines
656 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
from argparse import Namespace, ArgumentParser
from .Cmd import Cmd
from ..CmdDistro import CmdDistro
class CmdRebootRequired(Cmd): # export
def __init__(self, parent: CmdDistro) -> None:
super().__init__(parent, 'reboot-required', help="Check whether the machine needs rebooting")
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument('--verbose', default=False, action='store_true', help='Be chatty about the check')
async def _run(self, args: Namespace) -> None:
return await self.distro.reboot_required(verbose=args.verbose)