Skip to content

Support for clink completion #433

@zyf722

Description

@zyf722

Clink introduces multiple modern shell features to Windows cmd.exe, and it supports extending completions through Lua 5.2 scripts like:

clink.argmatcher("foo")
:addflags("-?", "-h", "-n", "-v", "--help", "--nothing", "--verbose")
:addarg("print", "delete")
:addarg(clink.filematches)
:nofiles()
:adddescriptions(
    { "-n", "--nothing",    description = "Do nothing; show what would happen without doing it" },
    { "-v", "--verbose",    description = "Verbose output" },
    { "-h", "--help", "-?", description = "Show help text" },
    { "print",              description = "Print the specified file" },
    { "delete",             description = "Delete the specified file" },
)

and

clink.argmatcher("git")
:addarg({
    "merge"..clink.argmatcher():addflags({
        "--strategy"..clink.argmatcher():addarg({
            "resolve",
            "recursive",
            "ours",
            "octopus",
            "subtree",
        })
    })
})

It would be great if support for generating clink completions (for tools like poetry) could be added. I'm glad to help if the idea gets considered by the team.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature requests/implementations

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions