Skip to content

Support the -- separator, e.g. git log -- dir/ #2108

@mytskine

Description

@mytskine

Request

A common pattern is to use -- to separate flags from other arguments, usually paths. It's a default behaviour for many programs, and libraries like getopt.

Proposed solution

From the top of my head, some commands that would benefit from this pattern:

  • git status -- some/dir<TAB> (same with diff, log, and many other commands)
  • bash -x -- .local/<TAB>
  • tree -d -- /etc/ng<TAB>

Anything else?

I could not find any completion that implements this. I tried to write one myself, but it seems that a -- argument breaks the parsing of carapace. In my tests, the callback passed to PositionalAnyCompletion() was never called for arguments after --. Unless I'm mistaken, the carapace API does not document this nor provide an alternative. I did not dig any further, so I may haved missed obvious solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions