Done with help2man:
$ help2man --no-discard-stderr -o spatch.1.in.allopt \
--help-option='-longhelp' --version-option='-version' \
../spatch.opt
---
docs/spatch.1.in | 431 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 429 insertions(+), 2 deletions(-)
diff --git a/docs/spatch.1.in b/docs/spatch.1.in
index 7d5340f..cb34870 100644
--- a/docs/spatch.1.in
+++ b/docs/spatch.1.in
@@ -109,8 +109,6 @@ see all the available options in different categories
.B \-help, \-\-help
show summary of options.
-
-
.SH EXAMPLES
./spatch -sp_file foo.cocci foo.c
@@ -135,6 +133,435 @@ If the semantic patch is not working as expected, the
option -debug
shows selection of information about the application of
a semantic patch to a file or directory.
+.SH MORE OPTIONS
+.IP "MAIN OPTIONS"
+.TP
+\fB\-\-sp\-file\fR
+<file> the semantic patch file
+.TP
+\fB\-o\fR
+<file> the output file
+.TP
+\fB\-\-in\-place\fR
+do the modification on the file directly
+.TP
+\fB\-\-backup\-suffix\fR
+suffix to use when making a backup for inplace
+.TP
+\fB\-\-out\-place\fR
+store modifications in a .cocci_res file
+.TP
+\fB\-\-reverse\fR
+invert the semantic patch before applying it
+.TP
+\fB\-U\fR
+set number of diff context lines
+.TP
+\fB\-\-partial\-match\fR
+report partial matches of the SP on the C file
+.TP
+\fB\-\-iso\-file\fR
+<file> (default=/usr/local/share/coccinelle/standard.iso)
+.TP
+\fB\-\-macro\-file\fR
+<file>
+.TP
+\fB\-\-macro\-file\-builtins\fR
+<file> (default=/usr/local/share/coccinelle/standard.h)
+.TP
+\fB\-\-recursive\-includes\fR
+causes all available include files, both those included in the C file(s) and
those included in header files, to be used
+.TP
+\fB\-\-all\-includes\fR
+causes all available include files included in the C file(s) to be used
+.TP
+\fB\-\-no\-includes\fR
+causes not even local include files to be used
+.TP
+\fB\-\-local\-includes\fR
+causes local include files to be used
+.TP
+\fB\-\-ignore\-unknown\-options\fR
+For integration in a toolchain (must be set before the first unknown option)
+.TP
+\fB\-\-include\-headers\fR
+process header files independently
+.TP
+\fB\-I\fR
+<dir> containing the header files (optional)
+.TP
+\fB\-\-preprocess\fR
+run the C preprocessor before applying the semantic match
+.TP
+\fB\-c\fR
+gcc/cpp compatibility mode
+.TP
+\fB\-\-dir\fR
+<dir> process all files in directory recursively
+.TP
+\fB\-\-use\-glimpse\fR
+works with \fB\-dir\fR, use info generated by glimpseindex
+.TP
+\fB\-\-use\-google\fR
+find relevant files using google code search
+.TP
+\fB\-\-use\-idutils\fR
+find relevant files using id\-utils
+.TP
+\fB\-\-patch\fR
+<dir> path name with respect to which a patch should be created
+.IP
+"" for a file in the current directory
+.TP
+\fB\-\-kbuild\-info\fR
+<file> improve \fB\-dir\fR by grouping related c files
+.TP
+\fB\-\-pyoutput\fR
+Sets output routine: Standard values:
<coccilib.output.Gtk|coccilib.output.Console>
+.TP
+\fB\-\-version\fR
+guess what
+.TP
+\fB\-\-date\fR
+guess what
+.TP
+\fB\-\-shorthelp\fR
+see short list of options
+.TP
+\fB\-\-longhelp\fR
+see all the available options in different categories
+.PP
+.IP "ALIASES AND OBSOLETE OPTIONS"
+.TP
+\fB\-\-sp\fR
+command line semantic patch
+.TP
+\fB\-\-iso\fR
+short option of \fB\-\-iso\-file\fR
+.TP
+\fB\-\-cocci\-file\fR
+<file> the semantic patch file
+.PP
+.IP "MOST USEFUL SHOW OPTIONS"
+.HP
+\fB\-\-show\-diff\fR
+.HP
+\fB\-\-no\-show\-diff\fR
+.TP
+\fB\-\-force\-diffshow\fR
+diff even if only spacing changes
+.HP
+\fB\-\-show\-flow\fR
+.HP
+\fB\-\-ctl\-inline\-let\fR
+.HP
+\fB\-\-ctl\-show\-mcodekind\fR
+.HP
+\fB\-\-show\-bindings\fR
+.HP
+\fB\-\-show\-transinfo\fR
+.HP
+\fB\-\-show\-misc\fR
+.TP
+\fB\-\-show\-trying\fR
+show the name of each function being processed
+.TP
+\fB\-\-show\-dependencies\fR
+show the dependencies related to each rule
+.PP
+.IP "VERBOSE SUBSYSTEMS OPTIONS"
+.HP
+\fB\-\-verbose\-ctl\-engine\fR
+.HP
+\fB\-\-verbose\-match\fR
+.HP
+\fB\-\-verbose\-engine\fR
+.TP
+\fB\-\-graphical\-trace\fR
+generate a pdf file representing the matching process
+.TP
+\fB\-\-gt\-without\-label\fR
+remove graph label (requires option \fB\-graphical\-trace\fR)
+.HP
+\fB\-\-parse\-error\-msg\fR
+.HP
+\fB\-\-verbose\-parsing\fR
+.HP
+\fB\-\-type\-error\-msg\fR
+.PP
+.IP "OTHER SHOW OPTIONS"
+.HP
+\fB\-\-show\-c\fR
+.HP
+\fB\-\-show\-cocci\fR
+.HP
+\fB\-\-show\-before\-fixed\-flow\fR
+.HP
+\fB\-\-show\-ctl\-tex\fR
+.HP
+\fB\-\-show\-ctl\-text\fR
+.HP
+\fB\-\-show\-SP\fR
+.PP
+.IP "DEBUG C PARSING/UNPARSING"
+.HP
+\fB\-\-debug\-cpp\fR
+.HP
+\fB\-\-debug\-lexer\fR
+.HP
+\fB\-\-debug\-etdt\fR
+.HP
+\fB\-\-debug\-typedef\fR
+.TP
+\fB\-\-filter\-msg\fR
+filter some cpp message when the macro is a "known" cpp construct
+.HP
+\fB\-\-filter\-define\-error\fR
+.TP
+\fB\-\-filter\-msg\-define\-error\fR
+filter the error msg
+.HP
+\fB\-\-filter\-passed\-level\fR
+.HP
+\fB\-\-debug\-unparsing\fR
+.PP
+.IP "SHORTCUT FOR ENABLING/DISABLING A SET OF DEBUGGING OPTIONS AT ONCE"
+.HP
+\fB\-\-quiet\fR
+.HP
+\fB\-\-very\-quiet\fR
+.HP
+\fB\-\-debug\fR
+.HP
+\fB\-\-pad\fR
+.PP
+.IP "BENCH OPTIONS"
+.TP
+\fB\-\-profile\fR
+gather timing information about the main coccinelle functions
+.TP
+\fB\-\-bench\fR
+<level> for profiling the CTL engine
+.TP
+\fB\-\-timeout\fR
+<sec> timeout in seconds
+.TP
+\fB\-\-steps\fR
+max number of model checking steps per code unit
+.TP
+\fB\-\-iso\-limit\fR
+max depth of iso application
+.TP
+\fB\-\-no\-iso\-limit\fR
+disable limit on max depth of iso application
+.TP
+\fB\-\-track\-iso\fR
+gather information about isomorphism usage
+.TP
+\fB\-\-disable\-iso\fR
+disable a specific isomorphism
+.TP
+\fB\-\-profile\-iso\fR
+gather information about the cost of isomorphism usage
+.PP
+.IP "CHANGE OF ALGORITHM OPTIONS"
+.TP
+\fB\-\-keep\-comments\fR
+keep comments around removed code
+.HP
+\fB\-\-loop\fR
+.TP
+\fB\-\-no\-loops\fR
+drop all back edges derived from looping constructs \- unsafe
+.TP
+\fB\-\-no\-gotos\fR
+drop all jumps derived from gotos \- unsafe
+.TP
+\fB\-\-no\-saved\-typedefs\fR
+drop all inferred typedefs from one parse of some code to the next
+.TP
+\fB\-\-ocaml\-regexps\fR
+use OCaml Str regular expressions for constraints
+.HP
+\fB\-\-l1\fR
+.TP
+\fB\-\-ifdef\-to\-if\fR
+convert ifdef to if (experimental)
+.TP
+\fB\-\-no\-ifdef\-to\-if\fR
+convert ifdef to if (experimental)
+.HP
+\fB\-\-disable\-multi\-pass\fR
+.HP
+\fB\-\-noif0\-passing\fR
+.HP
+\fB\-\-defined\fR
+.HP
+\fB\-\-undefined\fR
+.HP
+\fB\-\-noadd\-typedef\-root\fR
+.TP
+\fB\-\-disallow\-nested\-exps\fR
+disallow an expresion pattern from matching a term and its subterm
+.HP
+\fB\-\-disable\-worth\-trying\-opt\fR
+.HP
+\fB\-\-only\-return\-is\-error\-exitif\fR this flag is not set, then break and
continue are also error exits
+.TP
+\fB\-\-allow\-inconsistent\-paths\fR
+if this flag is set don't check for inconsistent paths; dangerous
+.TP
+\fB\-\-no\-safe\-expressions\fR
+make an expression disjunction not prioritise the topmost disjunct
+.TP
+\fB\-\-int\-bits\fR
+the number of bits in an unsigned int
+.TP
+\fB\-\-long\-bits\fR
+the number of bits in an unsigned long
+.TP
+\fB\-\-linux\-spacing\fR
+spacing of + code follows the conventions of Linux
+.TP
+\fB\-\-smpl\-spacing\fR
+spacing of + code follows the semantic patch
+.TP
+\fB\-D\fR
+indicate that a virtual rule should be considered to be matched
+.TP
+\fB\-\-c\fR++
+make a small attempt to parse C++ files
+.PP
+.IP "MISC OPTIONS"
+.TP
+\fB\-\-debugger\fR
+option to set if launch spatch in ocamldebug
+.TP
+\fB\-\-disable\-once\fR
+to print more messages
+.TP
+\fB\-\-show\-trace\-profile\fR
+show trace
+.HP
+\fB\-\-save\-tmp\-files\fR
+.PP
+.IP "CONCURRENCY"
+.TP
+\fB\-\-index\fR
+the processor to use for this run of spatch
+.TP
+\fB\-\-max\fR
+the number of processors available
+.TP
+\fB\-\-mod\-distrib\fR
+use mod to distribute files among the processors
+.PP
+.IP "PAD OPTIONS"
+.TP
+\fB\-\-use\-cache\fR
+use .ast_raw pre\-parsed cached C file
+.TP
+\fB\-\-cache\-prefix\fR
+directory of cached ASTs, sets \fB\-use\-cache\fR
+.TP
+\fB\-\-cache\-limit\fR
+maximum number of cached ASTs, sets \fB\-use\-cache\fR
+.PP
+.IP "TEST MODE AND TEST OPTIONS (WORKS WITH TESTS/ OR .OK FILES)"
+The test options don't work with the \fB\-\-sp\-file\fR and so on.
+.TP
+\fB\-\-test\fR
+<file> launch spatch on tests/file.[c,cocci]
+.TP
+\fB\-\-testall\fR
+launch spatch on all files in tests/ having a .res
+.TP
+\fB\-\-test\-okfailed\fR
+generates .{ok,failed,spatch_ok} files using .res files
+.TP
+\fB\-\-test\-regression\-okfailed\fR
+process the .{ok,failed,spatch_ok} files in current dir
+.TP
+\fB\-\-compare\-with\-expected\fR
+use also file.res
+.TP
+\fB\-\-expected\-score\-file\fR
+which score file to compare with in \fB\-testall\fR
+.TP
+\fB\-\-no\-update\-score\-file\fR
+do not update the score file when \fB\-testall\fR succeeds
+.HP
+\fB\-\-relax\-include\-path\fR
+.PP
+.IP "ACTION MODE"
+The action options don't work with the \fB\-\-sp\-file\fR and so on.
+It's for the other (internal) uses of the spatch program.
+.TP
+\fB\-\-tokens\-c\fR
+<file>
+.TP
+\fB\-\-parse\-c\fR
+<file or dir>
+.TP
+\fB\-\-parse\-h\fR
+<file or dir>
+.TP
+\fB\-\-parse\-ch\fR
+<file or dir>
+.TP
+\fB\-\-parse\-i\fR
+<file or dir>
+.TP
+\fB\-\-parse\fR
+<file or dir>
+.TP
+\fB\-\-show\-flow\fR
+<file or file:function>
+.TP
+\fB\-\-control\-flow\fR
+<file or file:function>
+.TP
+\fB\-\-control\-flow\-to\-file\fR
+<file or file:function>
+.TP
+\fB\-\-test\-cfg\-ifdef\fR
+<file>
+.TP
+\fB\-\-parse\-unparse\fR
+<file>
+.TP
+\fB\-\-type\-c\fR
+<file>
+.TP
+\fB\-\-compare\-c\fR
+<file1> <file2>
+.TP
+\fB\-\-comment\-annotater\-c\fR
+<file>
+.HP
+\fB\-\-compare\-c\-hardcoded\fR
+.TP
+\fB\-\-test\-attributes\fR
+<file>
+.TP
+\fB\-\-test\-cpp\fR
+<file>
+.TP
+\fB\-\-extract\-macros\fR
+<file or dir>
+.TP
+\fB\-\-extract\-macros\-select\fR
+<file or dir>
+.TP
+\fB\-\-xxx\fR
+<file1> <>
+.TP
+\fB\-\-parse\-cocci\fR
+<file>
+.TP
+\fB\-\-compare\-c\fR
+<file1> <file2>
+
.SH FILES
.I @SHAREDIR@/standard.iso
.RS
--
1.7.11.2
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)