Dave Jarvis' Repositories

git clone https://repo.autonoma.ca/repo/yamlp.git

Added usage to README.

Authordjarvis <email>
Date2016-09-21 22:35:44 GMT-0700
Commitf47a7e237285b58734c160625d8ef34fdeef819a
Parent8e91923
.gitignore
target
+dependency-reduced-pom.xml
README.md
# YAMLP
-YAMLP is a pre-processor for YAML.
-
-Given a YAML file such as:
+YAMLP is a pre-processor for YAML. Given a YAML file with delimited
+references such as:
---
a: A
b: $a$ B
c: $b$ C $b$
...
-This will write a new YAML file to standard output with the variables
-substituted from the YAML paths within the document:
+This will write a new YAML file to standard output with the references
+substituted using corresponding YAML path values from within the document:
---
a: A
b: A B
c: A B C A B
...
-This behaviour is based on the template mechanism used by the Markdown
-conversion tool [pandoc](http://pandoc.org/).
+This is similar to the template mechanism used by [pandoc](http://pandoc.org/)
+with the addition of recursive delimited references.
# Usage
Use the application as follows:
java -jar yamlp.jar --input variables.yaml > v.yaml
Be careful not to overwrite your original YAML files.
+
+# Errors
+
+Missing delimited references are written to standard error.
+
+# Options
+
+This section describes common command line arguments. Without supplying any
+arguments, the full list of options and descriptions are given.
+
+## Required
+
+* `--input` - path to the YAML file to process.
+
+## Optional
+
+* `--variables` - write all references to standard error.
+* `--quiet` - suppress writing missing references to standard error.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.whitemagicsoftware</groupId>
- <artifactId>yamlp</artifactId>
- <version>1.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <dependencies>
- <dependency>
- <groupId>org.yaml</groupId>
- <artifactId>snakeyaml</artifactId>
- <version>1.17</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.dataformat</groupId>
- <artifactId>jackson-dataformat-yaml</artifactId>
- <version>2.8.2</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.8.2</version>
- </dependency>
- <dependency>
- <groupId>args4j</groupId>
- <artifactId>args4j</artifactId>
- <version>2.33</version>
- </dependency>
- </dependencies>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
- </properties>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.whitemagicsoftware</groupId>
+ <artifactId>yamlp</artifactId>
+ <version>1.0</version>
+ <packaging>jar</packaging>
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <transformers>
+ <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+ <mainClass>com.whitemagicsoftware.yamlp.Main</mainClass>
+ </transformer>
+ </transformers>
+ <outputDirectory>/tmp</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.yaml</groupId>
+ <artifactId>snakeyaml</artifactId>
+ <version>1.17</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.dataformat</groupId>
+ <artifactId>jackson-dataformat-yaml</artifactId>
+ <version>2.8.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.fasterxml.jackson.core</groupId>
+ <artifactId>jackson-databind</artifactId>
+ <version>2.8.2</version>
+ </dependency>
+ <dependency>
+ <groupId>args4j</groupId>
+ <artifactId>args4j</artifactId>
+ <version>2.33</version>
+ </dependency>
+ </dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <maven.compiler.source>1.7</maven.compiler.source>
+ <maven.compiler.target>1.7</maven.compiler.target>
+ </properties>
</project>
Delta83 lines added, 39 lines removed, 44-line increase