eeverman / eeverman/andhow

Options uses java.io.tmpdir as replacement string wo delimiters

Open
#425 0 comments 0 reactions 0 assignees View on GitHub
API Change enhancement Needs More Info
Dominant language
Java
Stars
25
Forks
34
PR merge metrics
No merged PRs in 30d

Description

The Options class has a [SAMPLES_DIRECTORY Property](https://github.com/eeverman/andhow/blob/7cd5e0b350a231ad67435859287b0b60114cce50/andhow-core/src/main/java/org/yarnandtail/andhow/Options.java#L28) that can specify which directory to write configuration samples to.

Currently it replaces the string `java.io.tmpdir` with the actual temp directory, which is a special case and just seems like a hack - what if someone actually has a directory of that name?

It seems like some type of delimiter might be a better choice, such as:
* ${java.io.tmpdir} (used by lots of other systems)
* {{java.io.tmpdir}} (used by jinja)
* [[java.io.tmpdir]]
* . . .etc

For this one property, this special behavior is not a huge deal, however, it would also be nice to support a small list of replacement vars that could be used in any string property, such as:
* java.io.tmpdir
* file.separator
* line.separator
* path.separator
* user.dir
* user.home
* user.name

The trick is to pick some type of delimiters that are legal and don't have special meanings in any of the current or potential configuration sources, especially:
* command line args
* JNDI
* environmental vars (on any platform)
* properties files
* Java's XML version of properties files (java will read properties files as text or XML)
* YML (not currently supported by AndHow, but often used to configure env vars)
* JSON (same caveat)
* Jinja (same caveat)

What would be a good delimiter?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.