Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctags error with mac

Tags:

macos

ctags

I have exuberant tags in my mac. Since, yesterday i am getting this error ctags: illegal option -- R usage: ctags [-BFadtuwvx] [-f tagsfile] file ...

I have followed the steps mentoned in this After following the steps mentioned here i can run ctags -R from command line(iterm) But when i execute the same command from a .sh (i have a shell script where i run the cscope and ctags command using it) file i get the above error again but not when i run ctags -R from iterm directly.

Any pointers on solving this issue will be really helpfull. Thanks in advance

like image 887
Niel Avatar asked Dec 23 '22 07:12

Niel


2 Answers

So, the above issue seems to be fixed. The issue being that inside the ~/.bash_profile PATH variable should be set correctly. Even though my PATH variable was pointing to /usr/local/bin but /usr/bin appeared ahead of /usr/local/bin , hence somehow the ctags (when run from shell script) was picking up /usr/bin and not /usr/local/bin (which i have set alias to). Just move /usr/local/bin ahead of /usr/bin and it worked fine.

Solution Type this in terminal: export PATH="/usr/local/bin:/usr/bin:$PATH"

like image 82
Niel Avatar answered Dec 25 '22 21:12

Niel


Along with Neil answer you can simply add alias ctags='/usr/local/bin/ctags' to your .bashrc file.

like image 21
user1104154 Avatar answered Dec 25 '22 21:12

user1104154