gratools shell_completionο
Boost your productivity with Tab-completion for GraTools commands and options.
Shell completion allows you to auto-complete command names, options, and even file paths by simply pressing the Tab key. It prevents typos, saves time, and helps you discover available options without constantly checking the help menu.
π οΈ Optionsο
View Command Line Options
$ gratools shell_completion
Welcome to GraTools version: '1.2.0.dev19'
@author: GraTools team's
____ __________ ____
6MMMMMb/ MMMMMMMMMM `MM
8P YM / MM \ MM
6M Y ___ __ ___ MM _____ _____ MM ____
MM `MM 6MM 6MMMMb MM 6MMMMMb 6MMMMMb MM 6MMMMb\
MM MM69 " 8M' `Mb MM 6M' `Mb 6M' `Mb MM MM' `
MM ___ MM' ,oMM MM MM MM MM MM MM YM.
MM `M' MM ,6MM9'MM MM MM MM MM MM MM YMMMMb
YM M MM MM' MM MM MM MM MM MM MM `Mb
8b d9 MM MM. ,MM MM YM. ,M9 YM. ,M9 MM L ,MM
YMMMMM9 _MM_ `YMMM9'Yb_MM_ YMMMMM9 YMMMMM9 _MM_MYMMMM9
\ / /
/''A''\ /''''''\ / /''''A'''''\
...GC| |..ATG...C...CG...T....TAG..'..GC.| |...
\..C../ \.............../ \...TATA.../
Please cite our gitlab: https://forge.ird.fr/diade/gratools.git\
Usage: gratools shell_completion [OPTIONS]
Generates shell completion scripts for GraTools. This enables autocompletion
for commands, options, and arguments in your terminal, making it easier and
faster to use the GraTools CLI.
Supported shells: Bash, Zsh, Fish.
After generating the script, you'll need to source it or place it in the
appropriate directory for your shell to activate autocompletion. Instructions
will be provided upon script generation.
For more details, see the full documentation:
https://gratools.readthedocs.io/en/latest/commands/shell_completion.html
Options:
--shell [bash|zsh|fish]
Specify your shell type (bash, zsh, or fish) to generate the appropriate
completion script. [required]
--output-file PATH
Specify the full path (including filename) to save the generated completion
script. If not provided, defaults to 'gratools-completion.<shell>' in the
current directory.
-h, --help
Show this message and exit.
βΆοΈ Usage Examplesο
Follow these three steps to enable completion in your terminal environment.
Create the script for your specific shell (Bash or Zsh).
Tell your shell to load this script every time it starts.
Apply the changes to your current session.
Step 1: Generate the Scriptο
Run the command and specify your shell. We recommend saving it in your home directory.
$ gratools shell_completion --shell bash --output ~
# This creates: ~/gratools-completion.bash
Step 2: Configure your Shellο
Add the loading logic to your shell configuration file. Choose your shell below:
Append these lines to your ~/.bashrc (or ~/.bash_profile on macOS):
# Add completion for gratools
if [ -f "$HOME/gratools-completion.bash" ]; then
. "$HOME/gratools-completion.bash"
fi
Append these lines to your ~/.zshrc:
# Add completion for gratools
if [ -f "$HOME/gratools-completion.zsh" ]; then
source "$HOME/gratools-completion.zsh"
fi
Ensure the path in the script matches the actual location where you saved the file in Step 1.
Step 3: Reload Configurationο
Apply the changes immediately by βsourcingβ your config file:
source ~/.bashrc
source ~/.zshrc
βοΈ How It Worksο
Once configured, try these βmagicβ Tab sequences:
Type gratools list_ + Tab
$ gratools list_
list_chr list_samples
Type -- + Tab
$ gratools get_fasta --
--all-samples --num-threads
--chrom-query --sample-query
Type a path + Tab
$ gratools stats --gfa ./data-g
# Completes to:
$ gratools stats --gfa ./data-gratools/
If you are using Zsh with a framework like Oh My Zsh, make sure compinit is initialized in your .zshrc before sourcing the GraTools completion script for the best experience.
π Quick Links
Back to Hub: GraTools: A Pangenome GFA Toolkit
Workflow Guide: π¦ Installation