Sufler¶
Sufler - is the tool to help you with generating bash/zsh/powershell/fish autocompletions from YAML file.
Quickstart¶
Installation¶
To install Sufler, open an interactive shell and run:
pip install sufler
or
bash -c "$(curl -fsSL https://raw.githubusercontent.com/limebrains/sufler/master/install.bash)"
Using Sufler¶
To start using Sufler, you need to first install completions.
$ sufler install
Note
During installation. may appear message that ask for shell completer path if not detected automatically
You will have directory in your home dir where you can install your custom completions.
/Users/user/.sufler/
├── completions
│ ├── npm.yml
│ └── pip.yml
└── .config
There is repo which accepts PR’s with common completions sufler-completions - github
After installation just reload shell, type installed command and press double time Tab.
Creation of completion¶
For example, we want to add completion for command food, so we need to add his arguments in nodes after :
'food': &food
'fruit': &fruit
'orange': *fruit
'banana': *fruit
'strawberry': *fruit
'grape':
'green':
'red':
'grapefruit':
'"ruby red"':
'yellow':
'--seedless=': &seedless
'true': *food
'false': *food
'<Exec> ls':
'rm':
Note
We can add reference to any node of tree. E.g. if we want to repeat completions from ‘fruit’ after ‘orange’,
Advanced¶
Sufler has implemented support for advanced markers:
|