Skip to content

Feature request: Positional argument with default value #169

@NaruZosa

Description

@NaruZosa

Would it be possible to add support for default values for positional arguments, similarly to the standard Python argparse?

class Args(Tap):
    config_path: str = "config.yaml"
    force_update: bool = False

    @override
    def configure(self) -> None:
        """Add config_path as a positional argument with a default value."""
        self.add_argument("config_path", default="config.yaml")

It would be even better if 'config_path' doesn't need to be defined twice, but is still statically typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions