diff --git a/README.md b/README.md index 4b8d13a..971f1bb 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,10 @@ To execute a spec stored in the file `my-spec.json`, you would run: ```shell script jvcl my-spec.jvcl ``` +or to supply a spec using stdin and pipeline: +```shell script +cat my-spec.jvcl | jvcl +``` #### Scratch Directory Output assets will be placed in the scratch directory, unless otherwise specified diff --git a/bin/jtrim b/bin/jtrim index bb2ee0c..d7dd6bd 100755 --- a/bin/jtrim +++ b/bin/jtrim @@ -31,11 +31,9 @@ echo " \"name\": \"trimmed\", \"dest\": \"${OUT_FILE}\" }, - \"perform\": { - \"trim\": \"input\", - \"start\": \"${T_START}s\", - \"end\": \"${T_END}s\" - } + \"trim\": \"input\", + \"start\": \"${T_START}\", + \"end\": \"${T_END}\" } ] } diff --git a/bin/jvcl b/bin/jvcl index a4d8ff0..a239acb 100755 --- a/bin/jvcl +++ b/bin/jvcl @@ -4,10 +4,9 @@ # # Usage: # -# jvcl [-f spec-file] [-t temp-dir] +# jvcl [-t temp-dir] spec-file # -# If the `-f` option is omitted and no spec-file is provided, then jvcl will try to read -# a spec from stdin. +# If `spec-file` is omitted, then jvcl will try to read a spec from stdin. # # Every run of JVCL will create a temp directory. You can either specify the name of the directory # with `-t` (it will be created if it does not exist), or let jvcl create a temp directory for you. diff --git a/src/main/java/jvcl/main/JvclOptions.java b/src/main/java/jvcl/main/JvclOptions.java index 6ac3b91..6e65e8f 100644 --- a/src/main/java/jvcl/main/JvclOptions.java +++ b/src/main/java/jvcl/main/JvclOptions.java @@ -21,13 +21,13 @@ import static org.cobbzilla.util.json.JsonUtil.json; @Slf4j public class JvclOptions extends BaseMainOptions { - public static final String USAGE_SPEC = "Spec file to run. Set to '-' to read from stdin."; - @Argument(usage=USAGE_SPEC, required=true) + public static final String USAGE_SPEC = "Spec file to run. If omitted, read spec from stdin."; + @Argument(usage=USAGE_SPEC) @Getter @Setter private File specFile; public JSpec getSpec() { final String json; - if (specFile != null && !specFile.getName().equals("-")) { + if (specFile != null) { if (!specFile.exists() || !specFile.canRead()) return die("File not found or unreadable: "+abs(specFile)); json = toStringOrDie(specFile); } else {