@@ -72,6 +72,10 @@ To execute a spec stored in the file `my-spec.json`, you would run: | |||||
```shell script | ```shell script | ||||
jvcl my-spec.jvcl | jvcl my-spec.jvcl | ||||
``` | ``` | ||||
or to supply a spec using stdin and pipeline: | |||||
```shell script | |||||
cat my-spec.jvcl | jvcl | |||||
``` | |||||
#### Scratch Directory | #### Scratch Directory | ||||
Output assets will be placed in the scratch directory, unless otherwise specified | Output assets will be placed in the scratch directory, unless otherwise specified | ||||
@@ -31,11 +31,9 @@ echo " | |||||
\"name\": \"trimmed\", | \"name\": \"trimmed\", | ||||
\"dest\": \"${OUT_FILE}\" | \"dest\": \"${OUT_FILE}\" | ||||
}, | }, | ||||
\"perform\": { | |||||
\"trim\": \"input\", | |||||
\"start\": \"${T_START}s\", | |||||
\"end\": \"${T_END}s\" | |||||
} | |||||
\"trim\": \"input\", | |||||
\"start\": \"${T_START}\", | |||||
\"end\": \"${T_END}\" | |||||
} | } | ||||
] | ] | ||||
} | } | ||||
@@ -4,10 +4,9 @@ | |||||
# | # | ||||
# Usage: | # 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 | # 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. | # with `-t` (it will be created if it does not exist), or let jvcl create a temp directory for you. | ||||
@@ -21,13 +21,13 @@ import static org.cobbzilla.util.json.JsonUtil.json; | |||||
@Slf4j | @Slf4j | ||||
public class JvclOptions extends BaseMainOptions { | 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; | @Getter @Setter private File specFile; | ||||
public JSpec getSpec() { | public JSpec getSpec() { | ||||
final String json; | 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)); | if (!specFile.exists() || !specFile.canRead()) return die("File not found or unreadable: "+abs(specFile)); | ||||
json = toStringOrDie(specFile); | json = toStringOrDie(specFile); | ||||
} else { | } else { | ||||