-
-
Notifications
You must be signed in to change notification settings - Fork 189
Description
Hello,
I'm the author of crazy-complete and I've started working on a completion definition for legendary.
I know there are already two open issues about Bash completion, but the completions proposed there are not as fine-grained as mine.
You can find the definition file as well as pre-generated auto-completion files here inside the legendary directory.
Here's how you can try out the scripts:
- bash:
source ./generated/bash/legendary - fish:
source ./generated/fish/legendary.fish - zsh:
source ./generated/zsh/legendary.sourceable
The definition file is still a work in progress and has some gaps: In a few places I wasn't always
sure what the completion should be (e.g. whether an option should complete to a file or directory).
These spots are marked with # TODO comments in the definition file.
Here are some details about the setup:
-
The completion files are currently built via the
Makefile.
The following arguments are passed tocrazy-complete:--include-file=: Includes additional files into the generated output.
These contain helper functions used by crazy-complete.--inherit-options=True: Ensures that subcommands also inherit the options
of their parent command.
-
Some directives inside
legendary.yamlworth clarifying:final: true: Marks an option as final, meaning no more options may follow it.groups: [...]: Defines mutually exclusive groups of options.complete: ['exec', '<function>']: Executesfunctionand uses its output for completing.complete: ['combine', [...]]: Combines multiple completers into one.complete: ['choices', [...]]: Complete from a fixed list of words.complete: ['none']: Marks an option as taking an argument but without a completer.
Feedback and contributions, especially towards resolving the TODOs in the definition file, would be very welcome!