Skip to content

unlimited argument for an option with comma spliter #534

Open
@Alirezaaraby

Description

@Alirezaaraby

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the Typer documentation, with the integrated search.
  • I already searched in Google "How to X in Typer" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to Typer but to Click.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

import typer

def main(command: List[str] = typer.Option(None)):
    print(command)

Description

I want to pass unlimited multiple arguments to type.option with comma splitter like below.

$ python cli.py add test -C "hi I'm test", "hello this is test"

I want to get a list like ["hi I'm test","hello this is test"] from the above input.

Operating System

Windows

Operating System Details

Windows Version 10.0.19045.2486

Typer Version

0.7.0

Python Version

Python 3.9.1

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion or problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions