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

    Args:
        parser (argparse._SubParserAction): The parser object
    """
    subparser = parser.add_parser("init", help="Initialize sonar")

    subparser.set_defaults(func=api.Init.one_time_setup)
    subsubparser = subparser.add_subparsers(
        title="Commands", metavar="command"
    )

    def vivado():
        command = subsubparser.add_parser(
            "vivado",
            help="Add Vivado(s) to sonar's database",
            add_help=False,
            description="Adds all Vivado versions to sonar's database automatically",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "path", type=str, help="Path to Xilinx install folder"
        )
        command.set_defaults(func=api.Init.vivado)
        add_help(command)

    # def repo():
    #     command = subsubparser.add_parser(
    #         "repo",
    #         help="Create a new sonar repository",
    #         add_help=False,
    #         description="Creates a new sonar repository",
    #     )
    #     command_group = command.add_argument_group("Arguments")
    #     command_group.add_argument(
    #         "-p", "--path", type=str, help="Path to create repository"
    #     )
    #     command.set_defaults(func=api.Init.repo)
    #     add_help(command)

    # repo()
    vivado()

    Parse the "init" argument

    Args:
        parser (argparse._SubParserAction): The parser object
    
Parse the "init" argument
Parse the " init " argument
def init(parser):
    subparser = parser.add_parser("init", help="Initialize sonar")
    subparser.set_defaults(func=api.Init.one_time_setup)
    subsubparser = subparser.add_subparsers(
        title="Commands", metavar="command"
    )
    def vivado():
        command = subsubparser.add_parser(
            "vivado",
            help="Add Vivado(s) to sonar's database",
            add_help=False,
            description="Adds all Vivado versions to sonar's database automatically",
        )
        command_group = command.add_argument_group("Arguments")
        command_group.add_argument(
            "path", type=str, help="Path to Xilinx install folder"
        )
        command.set_defaults(func=api.Init.vivado)
        add_help(command)
    vivado()
def init ( parser ) : subparser = parser . add_parser ( "init" , help = "Initialize sonar" ) subparser . set_defaults ( func = api . Init . one_time_setup ) subsubparser = subparser . add_subparsers ( title = "Commands" , metavar = "command" ) def vivado ( ) : command = subsubparser . add_parser ( "vivado" , help = "Add Vivado(s) to sonar's database" , add_help = False , description = "Adds all Vivado versions to sonar's database automatically" , ) command_group = command . add_argument_group ( "Arguments" ) command_group . add_argument ( "path" , type = str , help = "Path to Xilinx install folder" ) command . set_defaults ( func = api . Init . vivado ) add_help ( command ) vivado ( )
Parse the "init" argument
Parse the " init " argument
"""
    Parse the "init" argument

    Args:
        parser (argparse._SubParserAction): The parser object
    """ # def repo(): #     command = subsubparser.add_parser( #         "repo", #         help="Create a new sonar repository", #         add_help=False, #         description="Creates a new sonar repository", #     ) #     command_group = command.add_argument_group("Arguments") #     command_group.add_argument( #         "-p", "--path", type=str, help="Path to create repository" #     ) #     command.set_defaults(func=api.Init.repo) #     add_help(command) # repo()
parser
The parser object
The parser object