diffblue-cbmc/scripts/bash-autocomplete
Joel Allred 71d8a14a0d Add zsh support to auto-complete
This required the replacement of calls to _filedir in the script.
2017-07-26 23:32:41 +01:00
..
.gitignore Autocomplete script for bash 2017-03-02 15:10:57 +00:00
Readme.md Add zsh support to auto-complete 2017-07-26 23:32:41 +01:00
cbmc.sh.template Add zsh support to auto-complete 2017-07-26 23:32:41 +01:00
extract_switches.sh Autocomplete script for bash 2017-03-02 15:10:57 +00:00
switch_extractor_helper.c Autocomplete script for bash 2017-03-02 15:10:57 +00:00

Readme.md

CBMC Autocomplete Scripts for Bash

This directory contains an autocomplete script for bash.

Installation for bash

  1. Compile cbmc and

  2. cd scripts/bash-autocomplete

  3. ./extract-switches.sh

  4. Put the following at the end of your ~/.bashrc, with the directories adapted to your directory structure:

    cbmcautocomplete=~/diffblue/cbmc/scripts/bash-autocomplete/cbmc.sh
    if [ -f $cbmcautocomplete ]; then
      . $cbmcautocomplete
    fi
    
  5. source ~/.bashrc

Installation for zsh

Follow 1. 2. and 3. as above.

  1. Put the following at the end of your ~/.zshrc, with the directories adapted to your directory structure:
    autoload bashcompinit
    bashcompinit
    cbmcautocomplete=~/diffblue/cbmc/scripts/bash-autocomplete/cbmc.sh
    if [ -f $cbmcautocomplete ]; then
      . $cbmcautocomplete
    fi
    
  2. source ~/.zshrc

Usage

As with the usual autocomplete in bash, start typing a switch to complete it, for example:

cbmc --clas<TAB>

will complete to

cbmc --classpath

Features implemented

  • Completing all switches
  • Completing values for --cover, --mm and --arch
  • When completing a name of a file to analyze, only files with supported extensions are shown.