Skip to content

Typing of optional subcommand #164

Answered by pawamoy
pawamoy asked this question in Q&A
Discussion options

You must be logged in to vote

As seen in #163, we can actually annotate the subcommand like this:

    subcommand: Annotated[
        Subcommand1 | Subcommand2 | None,
        cappa.Subcommand(),
    ] = None

...making this intuitive again 🙂

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DanCardin
Comment options

Answer selected by DanCardin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants