The previous API requires a temporary file to be created and sourced, which might be a problem in restricted environments where accessing to temporary directories are restricted or where file IO is relatively expensive. Besides, the temporary files are often left undeleted despite the rm line being sourced.
This PR proposes a way to print out the configuration headers through a new function optparse.compose, which can be evaluated (eval "$(optparse.compose)") or sourced (. <<(optparse.compose)) in the user scripts to include the configurations without the need of temporary files.
The changes are a backward-compatible, as optparse.build now write to the temporary file the result of optparse.compose plus the line remove $tempfile.
This PR also include some house-keeping such as removing trailing white spaces and tabs from the generated result, sample_head.sh and README.md.
The previous API requires a temporary file to be created and sourced, which might be a problem in restricted environments where accessing to temporary directories are restricted or where file IO is relatively expensive. Besides, the temporary files are often left undeleted despite the
rm
line being sourced.This PR proposes a way to print out the configuration headers through a new function
optparse.compose
, which can be evaluated (eval "$(optparse.compose)"
) or sourced (. <<(optparse.compose)
) in the user scripts to include the configurations without the need of temporary files.The changes are a backward-compatible, as
optparse.build
now write to the temporary file the result ofoptparse.compose
plus the lineremove $tempfile
.This PR also include some house-keeping such as removing trailing white spaces and tabs from the generated result,
sample_head.sh
andREADME.md
.