[Python] argparse add_argument alias

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    Is there a way to create an alias using argparse?

    For example, I want to do something like this:

    parser.add_argument('--foo' ...)
    parser.add_argument_alias('--bar', '--foo')


    That is, using --bar should be equivalent to using --foo.

    Continue reading...

Compartilhe esta Página