Also known as ectags, ctags.1, ctags(1)
ctags is a shell command that generates an index (tag) file of programmatic identifiers parsed from source code files of various programming languages to aid with code comprehension. The tags are often used by a source-code editor to lookup the definition of an identifier while the user develops the source code. Alternatively, the command supports an output format that is a human-readable cross reference.
ctags
pubs.opengroup.org →The ctags utility shall be provided on systems that support the the Software Development Utilities option, and either or both of the C-Language Development Utilities option and FORTRAN Development Utilities option. On other systems, it is optional. Write the object locator lists into tagsfile instead of the default file named tags in the current directory. Files with basenames ending with the .c suffix shall be treated as C-language source code. Such files that are not valid input to c99 produce unspecified results. Files with basenames ending with the .h suffix shall be treated as C-language source code. Such files that are not valid input to c99 produce unspecified results. Files with basenames ending with the .f suffix shall be treated as FORTRAN-language source code. Such files that are not valid input to fort77 produce unspecified results. The input files shall be text files containing source code in the language indicated by the operand filename suffixes. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the order in which output is sorted for the -x option. The POSIX locale determines the order in which the tagsfile is written. Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multi-byte characters in arguments and input files). When processing C-language source code, if the locale is not compatible with the C locale described by the ISO C standard, the results are unspecified. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( On systems that do not support the C-Language Development Utilities option, ctags produces unspecified results for C-language source code files. It should write to standard error a message identifying this condition and cause a non-zero exit status to be produced. If the operand identifies FORTRAN source, the ctags utility shall produce an output line for each function definition. It may also produce output for any of the following objects: On systems that do not support the FORTRAN Development Utilities option, ctags produces unspecified results for FORTRAN source code files. It should write to standard error a message identifying this condition and cause a non-zero exit status to be produced. The description of C-language processing says "attempts to" because the C language can be greatly confused, especially through the use of define s, and this utility would be of no use if the real C preprocessor were run to identify them. The output from ctags may be fooled and incorrect for various constructs. The option list was significantly reduced from that provided by historical implementations. The -F option was omitted as redundant, since it is the default. The -B option was omitted as being of very limited usefulness. The -t option was omitted since the recognition of typedef s is now required for C source files. The -u option was omitted because the update function was judged to be not only inefficient, but also rarely needed. An early proposal included a -w option to suppress warning diagnostics. Since the types of such diagnostics could not be described, the option was omitted as being not useful. The collation sequence of the tags file is not affected by LC COLLATE because it is typically not used by human readers, but only by programs such as vi to locate the tag within the source files. Using the POSIX locale eliminates some of the problems of coordinating locales between the ctags file creator and the vi file
~6 min read
ctags is a shell command that generates an index (tag) file of programmatic identifiers parsed from source code files of various programming languages to aid with code comprehension. The tags are often used by a source-code editor to lookup the definition of an identifier while the user develops the source code. Alternatively, the command supports an output format that is a human-readable cross reference.
The original was introduced in BSD Unix 2.0 and was written by Ken Arnold, with Fortran support by Jim Kleckner and Pascal support by Bill Joy. It is part of the initial release of Single Unix Specification and XPG4 of 1992.
Excerpt from a page describing this subject · 16,253 chars · not written by Vinony
via Wikidata · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).