The extra creativity offered by libraries comes at a cost: you have to
actually write your
main function and get your hands dirty in
managing user inputs: are all the necessary parameters given a value? is
the input in the correct format? do the options and the inputs correspond?
and many other similar checks. So when an operation has well-defined inputs
and outputs and is commonly needed, it is much more worthwhile to simply do
use all the great features that Gnuastro has already defined for such
To make it easier to learn/apply the internal program infra-structure discussed in Mandatory source code files, Gnuastro ships with a template program when using the Version controlled source. It is not available in the Gnuastro tarball so it doesn’t confuse people using the tarball. The bin/TEMPLATE directory in Gnuastro’s clone contains the bare-minimum files necessary to define a new program and all the necessary files/functions are pre-defined there. You can take the following steps if you want to add a new program to Gnuastro:
$ cp -R bin/TEMPLATE bin/myprog
AC_CONFIG_FILES, only here the ordering depends on the length of the name.
myprogin the file names and contents of the files in the bin/myprog/ directory.
$ autoreconf -f
Your new program will be built the next time you run
make. You can now start adding your special