0

I am new to linux.

I am trying to set up arcanist.

I am done with git clone and adding the path in environment variable, however I am confused on how to set up the tab completion for arcanist commands.

In the arcanist user guide it says that you need to add source /path/to/arcanist/resources/shell/bash-completion to your .bashrc, .profile files.

What are these files and how can I edit them to work with arcanist with the tab completion.

Mozak
  • 2,738
  • 4
  • 30
  • 49

2 Answers2

2

The .bashrc, found in your home directory, is the configuration file for that user for bash. There is a global bashrc usually located in /etc/bashrc.

The difference to .profile is that the .bashrc is executed every time you start a terminal (bash) while .profile only once when you use a login shell.

The command source loads everything that is inside the file you use with that command and treats it as if you wrote those commands in the .bashrc yourself. I guess in /path/to/arcanist/resources/shell/bash-completion are aliases/functions/etc. which enable tab-completion with arcanist.

Edit: for bash, the profile file is usually called .bash_profile.

ap0
  • 1,083
  • 1
  • 12
  • 37
  • Thanks for replying. That means every user on my ubuntu will be having it's own .bash_profile. And if I want to set something globally then I need to add in /etc/bashrc. Currently I can see below enteries in the file(.bash_profile) [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* So how should I add in here for --> source /path/to/arcanist/resources/shell/bash-completion – Mozak Sep 04 '14 at 08:17
  • Yes, this is correct. one `.bashrc` per user in the respectiv home directory of that user. For all users use `/etc/bashrc'. Ubuntu has a very good documentation, you should take a look at it. – ap0 Sep 04 '14 at 08:22
1

After lot of googling and asking people, I finally did it.

First of all I had to export the path where my arcanist code from the github has been cloned in the ~/.bashsrc file(in bold below)

export PATH="$PATH:$HOME/.rvm/bin:$HOME/arcanist/bin/"

After this command, I copied the function which was present in the /arcanist/resources/shell/bash-completion into the bashrc file

And then I closed and open the terminal and bingo I was able to get arc and it's command as auto completion on striking tab.

Thanks ap0 for the comments.

Mozak
  • 2,738
  • 4
  • 30
  • 49