main.py
import typer
from typing import List
def typer_main(
channels: List[int] = typer.Argument([1, 2, 3], help='List of channels'),
):
for channel in channels:
print(channel)
Run this code
python main.py
But i get thos error
TypeError: 'default' is not supported for nargs=-1.
It's unsupported by Typer:
(emphasis mine)
Source: CLI Arguments with Multiple Values - Typer
There's also an Github issue confirming the problem with moderately weird workarounds posted: Default value for optional multi-value argument · Issue #518