Skip to content

Commit

Permalink
add remaining commands #438
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed Feb 27, 2024
1 parent d3f5505 commit ca77d58
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions looper/command_models/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,47 @@ def create_model(self) -> Type[pydantic.BaseModel]:
CheckParserModel = CheckParser.create_model()

# CLEAN
CleanParser = Command(
"clean",
MESSAGE_BY_SUBCOMMAND["clean"],
[
ArgumentEnum.DRY_RUN.value,
ArgumentEnum.FORCE_YES.value,
],
)
CleanParserModel = CleanParser.create_model()

# INSPECT
# TODO Did this move to Eido?

# INIT
# TODO rename to `init-config` ?
InitParser = Command(
"init",
MESSAGE_BY_SUBCOMMAND["init"],
[
# Original command has force flag which is technically a different flag, but we should just use FORCE_YES
ArgumentEnum.FORCE_YES.value,
ArgumentEnum.OUTPUT_DIR.value,
],
)
InitParserModel = InitParser.create_model()

# INIT-PIFACE
# LINK
InitPifaceParser = Command(
"init-piface",
MESSAGE_BY_SUBCOMMAND["init-piface"],
[],
)
InitPifaceParserModel = InitPifaceParser.create_model()

# LINK
LinkParser = Command(
"link",
MESSAGE_BY_SUBCOMMAND["link"],
[],
)
LinkParserModel = LinkParser.create_model()

SUPPORTED_COMMANDS = [RunParser]

Expand Down Expand Up @@ -180,7 +216,14 @@ class TopLevelParser(pydantic.BaseModel):
check: Optional[CheckParserModel] = pydantic.Field(
description=CheckParser.description
)

clean: Optional[CleanParserModel] = pydantic.Field(
description=CleanParser.description
)
init: Optional[InitParserModel] = pydantic.Field(description=InitParser.description)
init_piface: Optional[InitPifaceParserModel] = pydantic.Field(
description=InitPifaceParser.description
)
link: Optional[LinkParserModel] = pydantic.Field(description=LinkParser.description)
# arguments
settings: Optional[str] = ArgumentEnum.SETTINGS.value.with_reduced_default()
pep_config: Optional[str] = ArgumentEnum.PEP_CONFIG.value.with_reduced_default()
Expand Down

0 comments on commit ca77d58

Please sign in to comment.