DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th May 2010
fender0107401's Avatar
fender0107401 fender0107401 is offline
Real Name: Li.
Port Guard
 
Join Date: May 2010
Location: China, Tian Jin.
Posts: 24
Thanked 0 Times in 0 Posts
Default How to replace "ectags" with "ctags"?

"Exuberant Ctags" support "-R" option, so I can run "ectags -R" to generate tags file recursively.

But "ctags", which is included in openbsd base system, do not support this option.

My question is how to replace "ectags" with "ctags"?

I mean how to generate tags file recursively with "ctags"?

In my opinion, if "ctags" can't generate tags file recursively, it is useless.
Reply With Quote
  #2   (View Single Post)  
Old 18th May 2010
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

Example: for 'C' source & header files:

find . -name \*.c -o -name \*.h | xargs ctags
Reply With Quote
  #3   (View Single Post)  
Old 18th May 2010
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,834
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by fender0107401 View Post
My question is how to replace "ectags" with "ctags"?
Why not install Exuberant Ctags which is available in the packages/ports system?

http://www.openbsd.org/4.6_packages/....tgz-long.html
Reply With Quote
  #4   (View Single Post)  
Old 18th May 2010
fender0107401's Avatar
fender0107401 fender0107401 is offline
Real Name: Li.
Port Guard
 
Join Date: May 2010
Location: China, Tian Jin.
Posts: 24
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by ephemera View Post
Example: for 'C' source & header files:

find . -name \*.c -o -name \*.h | xargs ctags
Thanks a lot.

I added it to a Makefile to call make run it.

Code:
$ cat Makefile                                                                 
################################################################################
#
# Generate tags for the project.
#
################################################################################

all:
	find . -name \*.c -o -name \*.h | xargs ctags

clean:
	rm tags

################################################################################
Quote:
Originally Posted by ocicat View Post
Why not install Exuberant Ctags which is available in the packages/ports system?

http://www.openbsd.org/4.6_packages/....tgz-long.html
I know I can install "Exuberant Ctags" but I think if there are similar program in the based system why install another one.
Reply With Quote
  #5   (View Single Post)  
Old 19th May 2010
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

The main reason to use ectags is for the multiple programming language support. For straight C development, just about any tags generator will do fine.

I frequently use different languages, so I frequently use ectags.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #6   (View Single Post)  
Old 16th April 2013
mjcross mjcross is offline
New User
 
Join Date: Jan 2013
Posts: 6
Thanked 0 Times in 0 Posts
Default

If your filenames might have spaces in them, then I would recommend doing it like this instead:
Code:
find . -print0 -type f -iname '*.[chly]' -or -iname '*.cpp' | xargs -0 ctags
Furthermore if performance isn't an issue it is better to let ctags decide whether the content is taggable rather than filtering on filenames, by simply doing:
Code:
find . -print0 -type f | xargs -0 ctags

Last edited by mjcross; 16th April 2013 at 10:05 AM. Reason: wrong tags
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A little confused. Do "snapshots" (vs dump=image) have any correlation, non-unix? jb_daefo FreeBSD General 9 21st November 2009 04:41 AM
Opera Port - conflicting pkgs in "make install" IronForge OpenBSD Packages and Ports 5 29th October 2009 05:10 AM
Fixed "xinit" after _7 _8, "how" here in case anyones' "X" breaks... using "nvidia" jb_daefo Guides 0 5th October 2009 09:31 PM
"Thanks" and "Edit Tags". diw Feedback and Suggestions 2 29th March 2009 12:06 AM
Newbie-friendly "printing in OpenBSD" guide wanted Shagbag OpenBSD Packages and Ports 5 7th July 2008 09:26 PM


All times are GMT. The time now is 12:33 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick