Skip to content

Autocomplete on 3rd level argument? #7

@esampaio

Description

@esampaio

First thanks a lot for this, besides being a well thought out framework, it gives us that little push to organize our scripts and share them with the team.

Now for my issue, I'm struggling with the autocompletion, I can make it work for the first level like:

❯ sub mage <tab>
foo        bar 

But I cant make it work on the second level, this is what happens:

❯ sub mage foo <tab>
foo        bar 

When I expected:

❯ sub mage foo <tab>
baz        fubar 

I've organised the files like:

libexec/sub-mage
libexec/sub-mage-foo
libexec/sub-mage-bar
libexec/sub-mage-foo-baz
libexec/sub-mage-foo-fubar

And put the --complete like this:

# Provide sub completions
if [ "$1" = "--complete" ]; then
    { echo foo; echo bar; } | sort | uniq
    exit;
fi

Thanks in advance for any help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions