Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Xophmeister committed Aug 25, 2023
1 parent 39f7a93 commit fdace00
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ Options:
- override: When multiple sources of configuration are available, the highest priority
source is taken. All values from lower priority sources are discarded
-v, --verbose...
Logging verbosity (increased per occurrence)
-h, --help
Print help (see a summary with '-h')
Expand Down Expand Up @@ -254,6 +257,9 @@ Options:
- override: When multiple sources of configuration are available, the highest priority
source is taken. All values from lower priority sources are discarded
-v, --verbose...
Logging verbosity (increased per occurrence)
-h, --help
Print help (see a summary with '-h')
```
Expand Down Expand Up @@ -317,6 +323,9 @@ Options:
- override: When multiple sources of configuration are available, the highest priority
source is taken. All values from lower priority sources are discarded
-v, --verbose...
Logging verbosity (increased per occurrence)
-h, --help
Print help (see a summary with '-h')
```
Expand Down Expand Up @@ -356,6 +365,9 @@ Options:
- override: When multiple sources of configuration are available, the highest priority
source is taken. All values from lower priority sources are discarded
-v, --verbose...
Logging verbosity (increased per occurrence)
-h, --help
Print help (see a summary with '-h')
```
Expand All @@ -364,6 +376,20 @@ Options:
Please refer to the [Configuration](#configuration-1) section below to
understand the different sources of configuration and collation modes.

#### Logging

By default, the Topiary CLI will only output error messages. You can
increase the logging verbosity with a respective number of
`-v`/`--verbose` flags:

| Verbosity Flag | Logging Level |
| :------------- | :---------------------- |
| None | Errors |
| `-v` | ...and warnings |
| `-vv` | ...and information |
| `-vvv` | ...and debugging output |
| `-vvvv` | ...and tracing output |

#### Exit Codes

The Topiary process will exit with a zero exit code upon successful
Expand Down Expand Up @@ -408,9 +434,6 @@ It will output the following formatted code:
{ "foo": "bar" }
```

Set the `RUST_LOG=debug` environment variable if you want to enable
debug logging.

## Configuration

Topiary is configured using `languages.toml` files. There are up to four
Expand Down Expand Up @@ -1252,16 +1275,16 @@ suggested way to work:
`crate::language::Language` and process it everywhere, then make a
mostly empty query file with just the `(#language!)` configuration.

4. Run `RUST_LOG=debug cargo test`.
4. Run `RUST_LOG=debug cargo test -p topiary input_output_tester`.

Provided it works, it should output a lot of log messages. Copy that
output to a text editor. You are particularly interested in the CST
output that starts with a line like this: `CST node: {Node
compilation_unit (0, 0) - (5942, 0)} - Named: true`.

:bulb: As an alternative to using the debugging output, the
`--visualise` command line option exists to output the Tree-sitter
syntax tree in a variety of formats.
`vis` visualisation subcommand line option exists to output the
Tree-sitter syntax tree in a variety of formats.

5. The test run will output all the differences between the actual
output and the expected output, e.g. missing spaces between tokens.
Expand Down

0 comments on commit fdace00

Please sign in to comment.