sonar/cli.py
def board(parser):
    """
    Parse the "board" argument

    Args:
        parser (argparse._SubParserAction): The parser object
    """
    subparser = parser.add_parser(
        "board", help="Manage board definitions", add_help=False
    )
    subsubparser = subparser.add_subparsers(
        title="Commands", metavar="command"
    )

    def add():
        command = subsubparser.add_parser(
            "add",
            help="Add a board",
            add_help=False,
            description=textwrap.dedent(
                """\
                Adds a board to the database
                """
            ),
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "path",
            type=str,
            help="Path to directory containing board definition",
        )
        command.set_defaults(func=api.Board.add)
        add_help(command)

    def remove():
        command = subsubparser.add_parser(
            "remove",
            help="Remove a board",
            add_help=False,
            description="Removes a board from the database",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name", type=str, help="Name of board to remove"
        )
        command.set_defaults(func=api.Board.remove)
        add_help(command)

    def show():
        command = subsubparser.add_parser(
            "show",
            help="Show information about a board",
            add_help=False,
            description="Shows information about a board",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name", type=str, help="Name of board to show"
        )
        command.set_defaults(func=api.Board.show)
        add_help(command)

    def clear():
        command = subsubparser.add_parser(
            "clear",
            help="Remove all boards",
            add_help=False,
            description="Removes all boards",
        )
        command.set_defaults(func=api.Board.clear)
        add_help(command)

    def f_activate():
        command = subsubparser.add_parser(
            "activate",
            help="Activate a board",
            add_help=False,
            description="Activates a board",
        )

        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name",
            type=str,
            help="Name of the board to activate",
        )
        command.set_defaults(func=api.Board.activate)
        add_help(command)

    def deactivate():
        command = subsubparser.add_parser(
            "deactivate",
            help="Deactivate the active board",
            add_help=False,
            description="Deactivates the active board",
        )

        command.set_defaults(func=api.Board.deactivate)
        add_help(command)

    def f_list():
        command = subsubparser.add_parser(
            "list",
            help="List all boards and active board",
            add_help=False,
            description="Lists all boards and active board",
        )
        command.set_defaults(func=api.Board.f_list)
        add_help(command)

    f_activate()
    add()
    clear()
    deactivate()
    f_list()
    remove()
    show()
    add_help(subparser)

    Parse the "board" argument

    Args:
        parser (argparse._SubParserAction): The parser object
    
Parse the "board" argument
Parse the " board " argument
def board(parser):
    subparser = parser.add_parser(
        "board", help="Manage board definitions", add_help=False
    )
    subsubparser = subparser.add_subparsers(
        title="Commands", metavar="command"
    )
    def add():
        command = subsubparser.add_parser(
            "add",
            help="Add a board",
            add_help=False,
            description=textwrap.dedent(
                """\
                Adds a board to the database
                """
            ),
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "path",
            type=str,
            help="Path to directory containing board definition",
        )
        command.set_defaults(func=api.Board.add)
        add_help(command)
    def remove():
        command = subsubparser.add_parser(
            "remove",
            help="Remove a board",
            add_help=False,
            description="Removes a board from the database",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name", type=str, help="Name of board to remove"
        )
        command.set_defaults(func=api.Board.remove)
        add_help(command)
    def show():
        command = subsubparser.add_parser(
            "show",
            help="Show information about a board",
            add_help=False,
            description="Shows information about a board",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name", type=str, help="Name of board to show"
        )
        command.set_defaults(func=api.Board.show)
        add_help(command)
    def clear():
        command = subsubparser.add_parser(
            "clear",
            help="Remove all boards",
            add_help=False,
            description="Removes all boards",
        )
        command.set_defaults(func=api.Board.clear)
        add_help(command)
    def f_activate():
        command = subsubparser.add_parser(
            "activate",
            help="Activate a board",
            add_help=False,
            description="Activates a board",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "name",
            type=str,
            help="Name of the board to activate",
        )
        command.set_defaults(func=api.Board.activate)
        add_help(command)
    def deactivate():
        command = subsubparser.add_parser(
            "deactivate",
            help="Deactivate the active board",
            add_help=False,
            description="Deactivates the active board",
        )
        command.set_defaults(func=api.Board.deactivate)
        add_help(command)
    def f_list():
        command = subsubparser.add_parser(
            "list",
            help="List all boards and active board",
            add_help=False,
            description="Lists all boards and active board",
        )
        command.set_defaults(func=api.Board.f_list)
        add_help(command)
    f_activate()
    add()
    clear()
    deactivate()
    f_list()
    remove()
    show()
    add_help(subparser)
def board ( parser ) : subparser = parser . add_parser ( "board" , help = "Manage board definitions" , add_help = False ) subsubparser = subparser . add_subparsers ( title = "Commands" , metavar = "command" ) def add ( ) : command = subsubparser . add_parser ( "add" , help = "Add a board" , add_help = False , description = textwrap . dedent ( """\
                Adds a board to the database
                """ ) , ) command_group = command . add_argument_group ( "Arguments" ) command_group . add_argument ( "path" , type = str , help = "Path to directory containing board definition" , ) command . set_defaults ( func = api . Board . add ) add_help ( command ) def remove ( ) : command = subsubparser . add_parser ( "remove" , help = "Remove a board" , add_help = False , description = "Removes a board from the database" , ) command_group = command . add_argument_group ( "Arguments" ) command_group . add_argument ( "name" , type = str , help = "Name of board to remove" ) command . set_defaults ( func = api . Board . remove ) add_help ( command ) def show ( ) : command = subsubparser . add_parser ( "show" , help = "Show information about a board" , add_help = False , description = "Shows information about a board" , ) command_group = command . add_argument_group ( "Arguments" ) command_group . add_argument ( "name" , type = str , help = "Name of board to show" ) command . set_defaults ( func = api . Board . show ) add_help ( command ) def clear ( ) : command = subsubparser . add_parser ( "clear" , help = "Remove all boards" , add_help = False , description = "Removes all boards" , ) command . set_defaults ( func = api . Board . clear ) add_help ( command ) def f_activate ( ) : command = subsubparser . add_parser ( "activate" , help = "Activate a board" , add_help = False , description = "Activates a board" , ) command_group = command . add_argument_group ( "Arguments" ) command_group . add_argument ( "name" , type = str , help = "Name of the board to activate" , ) command . set_defaults ( func = api . Board . activate ) add_help ( command ) def deactivate ( ) : command = subsubparser . add_parser ( "deactivate" , help = "Deactivate the active board" , add_help = False , description = "Deactivates the active board" , ) command . set_defaults ( func = api . Board . deactivate ) add_help ( command ) def f_list ( ) : command = subsubparser . add_parser ( "list" , help = "List all boards and active board" , add_help = False , description = "Lists all boards and active board" , ) command . set_defaults ( func = api . Board . f_list ) add_help ( command ) f_activate ( ) add ( ) clear ( ) deactivate ( ) f_list ( ) remove ( ) show ( ) add_help ( subparser )
Parse the "board" argument
Parse the " board " argument
"""
    Parse the "board" argument

    Args:
        parser (argparse._SubParserAction): The parser object
    """
parser
The parser object
The parser object