Usage
incf [Options] Filename
The file referenced by Filename will be referred to as the master file.
Options
- --includes, -i. Requires as argument the name of the directory containing the include files. The default includes directory is the current directory.
- --out, -o. Requires as argument the name of the output file. The default value is "if.out".
- --watch. This option sets a flag which causes the program to watch for changes to the included files or the master file and regenerate the output file when a change is detected.
- --help, -h. Prints a help page with the available options.
- --version, -v. Prints the version information.
Example
Suppose we have the following three files:
master.txt (5 lines)
Some text here on first line of master template
@include(include_me.txt)
Some more text here
@include(include_me_too.txt)
Text on final line of master template
include_me.txt (1 line)
Include me!
include_me_too.txt (2 lines)
Include me too!
Please?
And suppose they are organised in the following folder structure:
+ my_project
master.txt
+ includes
include_me.txt
include_me_too.txt
Then if we
cd into the
my_project folder and run the following command
incf -i includes -o output.txt master.txt
we will generate the following file
output.txt (6 lines)
Some text here on first line of master template
Include me!
Some more text here
Include me too!
Please?
Text on final line of master template
If you run the program with the --watch option, the output will be overwritten with a newer version whenever you make a change to any of the three input files.
Run incf -h to see the full list of options.