Package nzilbb.labbcat.util
Class CommandLine
java.lang.Object
nzilbb.util.CommandLineProgram
nzilbb.labbcat.util.CommandLine
@ProgramDescription(value="Command-line utility for making ad-hoc LaBB-CAT API calls.",
arguments="function [arg ...]")
public class CommandLine
extends nzilbb.util.CommandLineProgram
Command-line utility for making ad-hoc LaBB-CAT API calls.
The utility generally prints the JSON response from the server. e.g.
java -jar nzilbb.labbcat.jar --labbcaturl=… --username=… --password=… getLayerIds
… might print:
{"title":"LaBB-CAT","version":"20200212.1030","code":0,"errors":[],"messages":[],"model":"http://localhost:8080/labbcat/"}
Human-readable JSON can be obtained using the --indent
switch,
e.g.
java -jar nzilbb.labbcat.jar --indent --labbcaturl=… getLayer orthography
… might print:
{ "title": "LaBB-CAT", "version": "20200212.1030", "code": 0, "errors": [], "messages": [], "model": { "id": "orthography", "parentId": "transcript", "description": "Standard Orthography", "alignment": 0, "peers": false, "peersOverlap": false, "parentIncludes": false, "saturated": false, "type": "string", "validLabels": {}, "category": null } }
- Author:
- Robert Fromont robert@fromont.net.nz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter forindent
: Whether to indent JSON for readability.Getter forlabbcatUrl
: Base URL for the LaBB-CAT server.Getter forpassword
: Password for LaBB-CAT.Getter forusername
: Username for LaBB-CAT.Getter forverbose
: Whether to produce verbose logging.static void
Main entrypoint.Setter forindent
: Whether to indent JSON for readability.setLabbcatUrl
(String newLabbcatUrl) Setter forlabbcatUrl
: Base URL for the LaBB-CAT server.setPassword
(String newPassword) Setter forpassword
: Password for LaBB-CAT.setUsername
(String newUsername) Setter forusername
: Username for LaBB-CAT.setVerbose
(Boolean newVerbose) Setter forverbose
: Whether to produce verbose logging.void
start()
Start the utilityMethods inherited from class nzilbb.util.CommandLineProgram
error, error, getUsage, getV, getVersion, interpretPropertiesParameters, message, processArguments, setUsage, setV, setVersion, warning, warning
-
Constructor Details
-
CommandLine
public CommandLine()Default constructor.
-
-
Method Details
-
main
Main entrypoint.- Parameters:
argv
- Array or command-line parameters.
-
getLabbcatUrl
Getter forlabbcatUrl
: Base URL for the LaBB-CAT server.- Returns:
- Base URL for the LaBB-CAT server.
-
setLabbcatUrl
@Switch(value="Base URL for the LaBB-CAT server.", compulsory=true) public CommandLine setLabbcatUrl(String newLabbcatUrl) Setter forlabbcatUrl
: Base URL for the LaBB-CAT server.- Parameters:
newLabbcatUrl
- Base URL for the LaBB-CAT server.- Returns:
- A reference to this object, so that setters can be chained.
-
getUsername
Getter forusername
: Username for LaBB-CAT.- Returns:
- Username for LaBB-CAT.
-
setUsername
Setter forusername
: Username for LaBB-CAT.- Parameters:
newUsername
- Username for LaBB-CAT.- Returns:
- A reference to this object, so that setters can be chained.
-
getPassword
Getter forpassword
: Password for LaBB-CAT.- Returns:
- Password for LaBB-CAT.
-
setPassword
Setter forpassword
: Password for LaBB-CAT.- Parameters:
newPassword
- Password for LaBB-CAT.- Returns:
- A reference to this object, so that setters can be chained.
-
getVerbose
Getter forverbose
: Whether to produce verbose logging.- Returns:
- Whether to produce verbose logging.
-
setVerbose
Setter forverbose
: Whether to produce verbose logging.- Parameters:
newVerbose
- Whether to produce verbose logging.- Returns:
- A reference to this object, so that setters can be chained.
-
getIndent
Getter forindent
: Whether to indent JSON for readability.- Returns:
- Whether to indent JSON for readability.
-
setIndent
Setter forindent
: Whether to indent JSON for readability.- Parameters:
newIndent
- Whether to indent JSON for readability.- Returns:
- A reference to this object, so that setters can be chained.
-
start
public void start()Start the utility
-