-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📚 doc: add description of command line tool
- Loading branch information
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# CLI Tool | ||
|
||
All subcommands: | ||
|
||
* [watson encode](#watson-encode) | ||
* [watson decode](#watson-decode) | ||
|
||
## watson encode | ||
|
||
### Usage | ||
|
||
``` | ||
watson encode -t=TYPE [-initial-mode=MODE] [FILE] | ||
``` | ||
|
||
Converts `FILE` of type `TYPE` into Watson and outputs its Watson Representation to the standard output. | ||
|
||
If `FILE` is not specified, it uses the standard input. | ||
|
||
### Flags | ||
|
||
| flag | mandatory | type | default | description | | ||
| ---- | --------- | ---- | ------- | ----------- | | ||
| **-t** | no | `json`, `yaml`, `msgpack`, or `cbor` | `yaml` | input file format | | ||
| **-initial-mode** | no | `A` or `S` | `A` | initial mode of the lexer. see [the specification](./spec.md) for more details. | | ||
|
||
## watson decode | ||
|
||
|
||
### Usage | ||
|
||
``` | ||
watson decode -t=TYPE [-initial-mode=MODE] [-stack-size=SIZE] [FILES...] | ||
``` | ||
|
||
Converts Watson files `FILES` into another format that is specified by `TYPE` and outputs it to the standard output. | ||
|
||
If `FILES` is not specified, it uses the standard input. | ||
|
||
If multiple files are specified, they are executed sequencially by the same lexer and VM, that is, the mode of the lexer and the stack of the VM remains unchanged when the VM finished processing one file and continues to another. After processing the last file, a value at the top of the VM's stack is displayed. | ||
|
||
### Flags | ||
|
||
| flag | mandatory | type | default | description | | ||
| ---- | --------- | ---- | ------- | ----------- | | ||
| **-t** | no | `json`, `yaml`, `msgpack`, or `cbor` | `yaml` | input file format | | ||
| **-initial-mode** | no | `A` or `S` | `A` | initial mode of the lexer. see [the specification](./spec.md) for more details. | | ||
| **-stack-size** | no | integer | 1024 | stack size of the VM. see [the specification](./spec.md) for more details. | |