Skip to content

Missing @sort_by_option decorator for SortByOption #1777

Description

@thibgc

The docstring of the SortByOption class (in 7.18.0) alludes to a sort_by_option decorator:

        @command
        @table_format_option
        @sort_by_option(
            ("Package ID", "package_id"),
            ("Name", "package_name"),
            ("Manager", "manager_id"),
            ("Version", None),
        )
        @pass_context
        def my_cmd(ctx):
            ctx.print_table(header_defs, rows)

but it doesn't seem to exist. Could this be added so that the sort option could be grouped with other options or be part of constraints?

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✨ enhancementNew feature or improvement to an existing one

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions