Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldcampbelljr committed May 15, 2024
1 parent 833c41c commit eca5c64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion looper/command_models/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

from ..const import MESSAGE_BY_SUBCOMMAND
from .arguments import Argument, ArgumentEnum
from pydantic2_argparse import ArgumentParser


@dataclass
Expand Down Expand Up @@ -234,10 +235,13 @@ def create_model(self) -> Type[pydantic.BaseModel]:
InitPifaceParserModel = InitPifaceParser.create_model()


def add_short_arguments(parser):
def add_short_arguments(parser: ArgumentParser) -> ArgumentParser:
"""
This function takes a parser object created under pydantic argparse and adds the short arguments AFTER the initial creation.
This is a workaround as pydantic-argparse does not currently support this during initial parser creation.
:param ArgumentParser
:return ArgumentParser
"""
# Loop through commands, add relevant short arguments
# Note there are three long form arguments that have 'f' as a short form. However, they are used on 3 separate commands.
Expand Down

0 comments on commit eca5c64

Please sign in to comment.