forked from regit/coccigrep
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coccigrep.1
150 lines (133 loc) · 3.93 KB
/
coccigrep.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.TH coccigrep 1 "October 16, 2011" "version 1.3"
.SH NAME
coccigrep - semantic grep for the C programming language
.SH SYNOPSIS
.B coccigrep
.RI [ OPTIONS ]
.BI "\-t " "TYPE "
.RI [ FILE .\|.\|.]
.SH DESCRIPTION
.BR coccigrep " is a semantic " grep " for the C programming language."
.RB "It is based on " coccinelle " and can be used to find where a given"
.RB "structure is used in C source files. " coccigrep " depends"
.RB "on the " spatch " program which comes with coccinelle."
.SH OPTIONS
.SS Display options
.TP
.BI \-A " NUM" "\fR,\fP \-\^\-after\-context=" NUM
.RI "Print " NUM " lines of trailing context after matching line."
.TP
.BI \-B " NUM" "\fR,\fP \-\^\-before\-context=" NUM
.RI "Print " NUM " lines of leading context before matching line."
.TP
.BR \-c ", " \-\-color
Colorize output (needs pygments).
.TP
.BI \-C " NUM" "\fR,\fP \-\^\-context=" NUM
.RI "Print " NUM " lines of output context."
.TP
.BI \-f " FORMAT" "\fR,\fP \-\^\-output-format=" FORMAT
Colorize format for output.
.I FORMAT
.RB "is " term " or " html .
.SS Search options
.TP
.BI \-a " ATTRIBUTE" "\fR,\fP \-\^\-attribut=" ATTRIBUTE
.RI "Match operations that involve the field " ATTRIBUTE " of the"
.RB "structure given with option " \-t "."
.TP
.B \-\-cpp
Activate coccinelle C++ support.
.TP
.BI \-o " OPERATION" "\fR,\fP \-\^\-operation=" OPERATION
Specify the kind of operation to look for.
.RI "The available values for " OPERATION " are:"
.RS
.B deref
.RS
.RI "Any access to an " ATTRIBUTE .
.RE
.B func
.RS
.RI "Any function call for which one of the parameters is of type " TYPE
.RB "(as defined with " \-t "). In this operation, the option " \-a " sets"
the name of the function to match and does not refer to an attribute.
.RE
.B set
.RS
.RI "Any operation wich changes the value of an " ATTRIBUTE .
.RE
.B test
.RS
.RI "Any boolean test where an " ATTRIBUTE " appears."
.RE
.B used
.RS
.RI "Any statement where the type " TYPE " (as defined with"
.BR \-t ") appears."
.RI "This " OPERATION " does not need to look for an " ATTRIBUTE " thus"
.RB "it ignores option " \-a .
.RE
.RB "The default operation is " used " if " \-a " is not given,"
.RB "or " deref " if it is."
.RI "Depending on your environment, more " OPERATION "s may be available."
.RB "See option " \-L " for information about"
.IR OPERATION " listing."
.RE
.TP
.BI \-t " TYPE" "\fR,\fP \-\^\-type=" TYPE
C type to look for.
.SS Editor options
.TP
.BR \-E ", " \-\-emacs
Emacs output.
.TP
.BR \-V ", " \-\-vim
Vim output.
.SS Program information
.TP
.BR \-h ", " \-\-help
Print usage message and exit.
.TP
.BR \-L ", " \-\-list-operations
.RI "List available " OPERATION "s. Use together with"
.BR \-v " to get detailed information about listed"
.IR OPERATION "s."
.TP
.BR \-v ", " \-\-verbose
Verbose output (including coccinelle errors).
.TP
.B \-\-version
.RB "Print the version number of " coccigrep "."
.SS Other options
.TP
.BI \-p " NCPUS" "\fR,\fP \-\^\-process=" NCPUS
Number of cpus to use.
.TP
.BI \-s " SP" "\fR,\fP \-\^\-sp=" SP
Semantic patch to use.
.TP
.BI \-l " FILE" "\fR,\fP \-\^\-file\-list=" FILE
File containing a list of input files.
.SH BUGS
The operation option could lead to some missed match because the semantic
patches used internally may need some improvements.
.RB "Use options " \-L " together with " \-v " to get detailed information"
about available operations.
.RB "Please report issues to <" https://github.com/regit/coccigrep/issues ">."
All ideas are welcome.
.SH EXAMPLES
.nf
.RB "1. Find where in a set of files the structure " Packet " is used:"
$ coccigrep -t Packet *c
.nf
.RB "2. Finds where in a set of files the " datalink " attribute is used in the structure " Packet ":"
$ coccigrep -t Packet -a datalink *c
.nf
.RB "3. Finds where the " datalink " attribute of " Packet " is set:"
$ coccigrep -t Packet -a datalink -o set source*c
.SH FILES
.IR ~/.coccigrep "\tConfiguration file for coccigrep."
.SH SEE ALSO
spatch(1)
.RB "Project homepage: <" http://home.regit.org/software/coccigrep/ ">"