generate a tree of includes and save it to `<output_file>`
(or print to standard output if `<output_file>` not given)
-`flatten`:
flatten an nginx config file by inlining all includes recursively,
save to `<output_file>` (or to standard output if <output_file> not given)
...
...
@@ -40,6 +44,18 @@ Once output is ready (either in the form of a single flattened `nginx` config fi
The `flatten` mode makes an honest attempt at keeping indentation sane. This means looking at an `include` line, and indenting the text included from the relevant files by whatever indent was there in the `include` line. This seems to work reasonably well, but if you want the config to be linted and nicely formatted, use a linter and [a formatter](https://github.com/1connect/nginx-config-formatter).
### Assumptions:
- the input config is a valid `nginx` config
- include file paths do not contain spaces
*(this seems compatible with how nginx handles includes)*
- no files are included from above the base directory if the input nginx
config file
## FAQ
-**Why Bash? (Python|Ruby|Rust|OCaml|COBOL|FORTRAN) would have been so much (harder|better|faster|stronger)?**