This is a tool that I have long wished somebody else would make. I'm struggling to produce a good one-line or even one-paragraph description of what exactly it does, but a good analogy is the Linux kernel's `menuconfig` or CMake's curses-based `ccmake` configuration editor, except that rather than operating on a highly constrained config file format, it can edit basically any textual format in place, as long as that format has some notion of comments. The comments then can be made to hide "meta-instructions" that confy understands: define a number of typed parameters, perform some simple computations on them, and either inactivate or activate (by (un)commenting) designated blocks of the "object-level" file, or outright regenerate them from a template. As a basic example, you could write
//! bool $flag = true;
//! if($flag) {
printf("The flag is true!");
//! } else {
//-printf("The flag is false!");
//! }
and confy would expose a graphical interface to toggle "$flag" on or off, and comment/uncomment the appropriate line of text in the file, while also saving the updated initial value in the first line that defines $flag in the file.
Interaction is possible both via a curses-style terminal interface, and by scriptable getters/setters (like `confy filename.txt set variableName true` or `confy filename.txt get variableName`).