Skip to content

[feature] support choice with description? #88

Description

@Freed-Wu

zsh/fish support choices with description, like:

❯ pip download --<TAB>
implementation
cp   cpython
ip   ironpython
jy   jython
pp   pypy
py   implementation-agnostic

A new feature

    parser.add_argument("--implementation", choices=["py", "cp", "pp", "ip", "jy"]).complete = {"cpython", "ironpython", "jython", "pypy", "implementation-agnostic"}
    # len(complete) must = len(choices), or complete must be a dict which keys is choices

Result:

  "--implementation: :((pp\:pypy jy\:jython cp\:cpython ip\:ironpython py\:implementation-agnostic))"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions