=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ctags/ctags.1,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- src/usr.bin/ctags/ctags.1 2000/03/04 22:19:22 1.8 +++ src/usr.bin/ctags/ctags.1 2000/03/05 20:09:21 1.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ctags.1,v 1.8 2000/03/04 22:19:22 aaron Exp $ +.\" $OpenBSD: ctags.1,v 1.9 2000/03/05 20:09:21 aaron Exp $ .\" $NetBSD: ctags.1,v 1.4 1995/03/26 20:14:04 glass Exp $ .\" .\" Copyright (c) 1987, 1990, 1993 @@ -57,6 +57,7 @@ Each line of the tags file contains the object name, the file in which it is defined, and a search pattern for the object definition, separated by whitespace. +.Pp Using the .Ar tags file, @@ -66,6 +67,8 @@ .Nm ctags , objects will consist of subroutines, typedefs, defines, structs, enums, and unions. +.Pp +The options are as follows: .Bl -tag -width Ds .It Fl B Use backward searching patterns @@ -96,16 +99,18 @@ .Ar tags file, that is, all references to them are deleted, and the new values are appended to the -file. (Beware: this option is implemented in a way which is rather +file. +(Beware: this option is implemented in a way which is rather slow; it is usually faster to simply rebuild the .Ar tags file.) .It Fl v An index of the form expected by .Xr vgrind 1 -is produced on the standard output. This listing -contains the object name, file name, and page number (assuming 64 -line pages). Since the output will be sorted into lexicographic order, +is produced on the standard output. +This listing contains the object name, file name, and page number (assuming +64 line pages). +Since the output will be sorted into lexicographic order, it may be desired to run the output through .Xr sort 1 . Sample use: @@ -119,44 +124,48 @@ .Nm produces a list of object names, the line number and file name on which each is defined, as well -as the text of that line and prints this on the standard output. This -is a simple index which can be printed out as an off-line readable +as the text of that line and prints this on the standard output. +This is a simple index which can be printed out as an off-line readable function index. .El .Pp Files whose names end in -.Nm \&.c +.Dq \&.c or -.Nm \&.h +.Dq \&.h are assumed to be C source files and are searched for C style routine and macro definitions. Files whose names end in -.Nm \&.y +.Dq \&.y are assumed to be .Tn YACC source files. Files whose names end in -.Nm \&.l +.Dq \&.l are assumed to be lisp files if their -first non-blank character is `;', `(', or `[', +first non-blank character is +.Ql \&; , +.Ql ( , +or +.Ql [ , otherwise, they are -treated as lex files. Other files are first examined to see if they +treated as lex files. +Other files are first examined to see if they contain any Pascal or Fortran routine definitions, and, if not, are searched for C style definitions. .Pp The tag .Li main -is treated specially in C programs. The tag formed -is created by prepending -.Ar M +is treated specially in C programs. +The tag formed is created by prepending +.Sq M to the name of the file, with the trailing -.Nm \&.c -and any leading pathname components removed. This -makes use of +.Dq \&.c +and any leading pathname components removed. +This makes use of .Nm -practical in directories with more than one -program. +practical in directories with more than one program. .Pp Yacc and lex files each have a special tag. .Ar Yyparse @@ -185,7 +194,8 @@ .Nm procedures for .Tn FORTRAN -and Pascal is done in a very simple-minded way. No attempt +and Pascal is done in a very simple-minded way. +No attempt is made to deal with block structure; if you have two Pascal procedures in different blocks with the same name you lose. .Nm @@ -198,8 +208,9 @@ .Pp .Nm relies on the input being well formed, and any syntactical -errors will completely confuse it. It also finds some legal syntax -confusing; for example, since it doesn't understand +errors will completely confuse it. +It also finds some legal syntax confusing; for example, +since it doesn't understand .Li #ifdef Ns 's (incidentally, that's a feature, not a bug), any code with unbalanced braces inside @@ -207,7 +218,8 @@ will cause it to become somewhat disoriented. In a similar fashion, multiple line changes within a definition will cause it to enter the last line of the object, rather than the first, as -the searching pattern. The last line of multiple line +the searching pattern. +The last line of multiple line .Li typedef Ns 's will similarly be noted. .Sh HISTORY