addinclude(1)

NAME
addinclude - adds an include to a C header- or source file

SYNOPSIS
addinclude filename include

DESCRIPTION
Addinclude provides a simple way to add includes to C header files or C source files.

Sometimes, a patch is overkill and search and replace does not cut it.

Addinclude adds the includes after the first #ifdef and preferrably together with the other #include lines.

If the header is empty, or there are no #ifdefs or #includes, the include is inserted at the top of the file.

EXAMPLES
addinclude - by itself returns errorcode 1 at exit

addinclude myfile.h '#include <string.h>' - adds #include <string.h> to myfile.h

addinclude myfile.h stdlib - adds #include <stdlib.h> to myfile.h

addinclude myfile.h '"some.h"' - adds #include "some.h" to myfile.h

addinclude --nofix myfile.h '"#include <some>"' - don't change the include text

addinclude --top myfile.h '"#include <firstpost.h>"' - place the include at the top

addinclude --test - performs self-testing

OPTIONS

--version or -v
    displays the current version number

--help or -h
    displays brief informative text about usage

--nofix or -n
    don't change the given include text

--top or -t
    add the include at the very top

WHY

Aims to solve a tiny problem properly instead of a thousand problems halfway, in true UNIX-spirit

Makes a common case easy to solve

Has clear syntax

Is only one small executable, not a big package

SEE ALSO
sed(1)

BUGS
Only unknown bugs so far.

AUTHOR
addinclude was written by Alexander Rødseth <rodseth@gmail.com>.