• Category Archives Bash
  • Bash completion for fabric

    As I was doing a routine migration of a WordPress site this morning I was looking at the fabric menu ( fab -l ) that had grown painfully long. And I wondered: “Would’nt it be nice if I counld just be typing the first letter in he fabric task and then hit tab to get the rest of it?”

    Google next, and there on GitHub, just the thing I needed: Fabric-completion.

    Enter Salt master, edit my user state, state.highstate, and voila: Fabric bash completion 🙂

    It works for task aliases as well 😉

  • Bash completion and git prompt

    Recently I discovered that the virtual server I was working on did not give me the usual bash completion I’m so used to on my Kubuntu workstations. Working on git repositories and upgrading web applications made this to an itch I just had to scratch.

    After a bit of searching it appeared that I was missing a file: /etc/bash_completion. Next I discovered that there is a /etc/bash_completion.d/ directory and under this a file named ‘git’. I copied the bash_completion file from my workstation and followed the instruction in /etc/bash_completion.d/git and suddenly I had bash completion and a prompt that gave me branch name and the status of the git repository I was currently in.

    Just to give you a hint, here is the comment from the /etc/bash_completion.d/git file: