Shell Completion
FoBiS.py provides native tab completion for bash, zsh, fish, and PowerShell. Once installed, pressing Tab completes subcommands, option names, and many option values.
Installing completion
Run the one-time installation command for your shell:
fobis --install-completion bash
# then reload your shell (or open a new terminal)
source ~/.bashrcfobis --install-completion zsh
source ~/.zshrcfobis --install-completion fish
# fish picks up completions from ~/.config/fish/completions/ automaticallyfobis --install-completion powershell
# follow any additional instructions printed by the commandTo preview the completion script without installing it:
fobis --show-completion bash # or zsh / fish / powershellWhat gets completed
Subcommands
fobis <Tab>
build clean rule doctests fetch installOption names
All long option names complete after --:
fobis build --<Tab>
--compiler --cflags --lflags --mode --mklib --src ...Option values with smart completion
Several options offer value completion — the completions are filtered as you type:
| Option | Completions |
|---|---|
--compiler | gnu, intel, intel_nextgen, g95, opencoarrays-gnu, pgi, ibm, nag, nvfortran, amd, custom |
--mklib | static, shared |
--mode | modes read live from the active fobos file |
--extensions | all built-in Fortran file extensions |
--inc | all built-in include file extensions |
--doctests-preprocessor | cpp, fpp |
--compiler completion example
fobis build --compiler <Tab>
gnu intel intel_nextgen g95 opencoarrays-gnu pgi ibm nag nvfortran amd custom
fobis build --compiler in<Tab>
intel intel_nextgen--mode live completion example
Given a fobos file with modes debug, release, and coverage:
fobis build --mode <Tab>
debug release coverage
fobis build --mode r<Tab>
releaseThe completion reads the fobos file named by --fobos (or the default fobos in the current directory) at completion time, so the list always reflects your actual project.
Verifying completion is active
# Should show the completion function / script path
type _FoBiS_py_completion # bash / zshIf completion does not activate after reloading your shell, re-run the install command — it will show where the completion script was written.
Uninstalling completion
The completion script is written to a shell-specific location. To remove it:
# The install command reports the path; typically:
rm ~/.bash_completions/FoBiS.py.sh
# and remove the source line from ~/.bashrcrm ~/.zfunc/_FoBiS.py
# and remove the fpath entry from ~/.zshrc if presentrm ~/.config/fish/completions/FoBiS.py.fishTroubleshooting
Completion not working after install
- Make sure you sourced your shell config (
source ~/.bashrc, etc.) or opened a new terminal. - For zsh, ensure
autoload -Uz compinit && compinitappears in~/.zshrcafter the fpath entry added by FoBiS.py.
--mode shows no completions
- A
fobosfile must exist in the current directory, or you must pass--fobos path/to/fobosbefore--modeon the command line.
No completions in a virtual environment
- Completion is installed for the Python environment that is active when you run
--install-completion. Activate the same environment before using FoBiS.py in your shell.