Completion Mode
Purpose
- Generate handy completions for common shell varieties (bash, fish, elvish, powershell, zsh).
Usage
metrical completion [OPTIONS] --shell <SHELL>
Concepts
This command is purely for supplementing your MetriCal experience with automatic completions from
the terminal. Since it's common to invoke MetriCal using a bash function or alias, use the
--invocation
argument to specify the string with which you'll invoke MetriCal to get the right
completions.
Sourcing the Completion File
Don't forget to source
the appropriate completion file before attempting to use completion! For a
temporary solution, just run source
:
source <shell_completion_file>
Otherwise, save the file in a canonical location to automatically load it during any shell session. Some locations are listed below; note that this list is not exhaustive, and may change depending on your configuration.
Shell | Location (example for metrical alias) |
---|---|
bash | /usr/local/etc/bash_completion.d/metrical.bash |
zsh | ~/.zsh/_metrical |
fish | ~/.config/fish/completions/metrical.fish |
elvish | ~/.elvish/metrical.elv |
powershell | execute _metrical.ps1 script in PowerShell |
Examples
Generate Completions for Bash
metrical completion -i metrical -s bash > $OUTPUT
...where
$OUTPUT
is the file to pipe the output into.
Options
-i, --invocation [INVOCATION]
The binary name being invoked, e.g.
metrical
. The default value is the 0th argument of the current invocation. This is useful if you're using an alias or function to invoke MetriCal.
-s, --shell [SHELL]
The shell variant to generate. Valid values:
bash
: bash completion file.zsh
: zsh completion file.fish
: Fish completion file.elvish
: Elvish completion file.powershell
: Powershell completion file.