Skip to content

Commit

Permalink
apio init: add --top-module parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Obijuan committed Feb 20, 2024
1 parent 7878d18 commit f60ec5c
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions apio/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,28 @@
from apio.managers.project import Project


# R0913: Too many arguments (6/5)
# pylint: disable=R0913
@click.command("init")
@click.pass_context
@click.option(
"-s", "--scons", is_flag=True, help="Create default SConstruct file."
)
@click.option(
"-b",
"--board",
type=str,
metavar="board",
help="Create init file with the selected board.",
)
@click.option(
"-t",
"--top-module",
type=str,
metavar="top_module",
default="main",
help="Set the top_module in the init file",
)
@click.option(
"-s", "--scons", is_flag=True, help="Create default SConstruct file."
)
@click.option(
"-p",
"--project-dir",
Expand All @@ -35,12 +45,12 @@
is_flag=True,
help="Automatically answer YES to all the questions.",
)
def cli(ctx, board, scons, project_dir, sayyes):
def cli(ctx, board, top_module, scons, project_dir, sayyes):
"""Manage apio projects."""

if scons:
Project().create_sconstruct(project_dir, "ice40", sayyes)
elif board:
Project().create_ini(board, project_dir, sayyes)
Project().create_ini(board, top_module, project_dir, sayyes)
else:
click.secho(ctx.get_help())

0 comments on commit f60ec5c

Please sign in to comment.