From d0006988470796e8ff37ea3b0677d24ac99d7cf6 Mon Sep 17 00:00:00 2001 From: Will Lillis Date: Thu, 31 Jul 2025 21:58:40 -0400 Subject: [PATCH] fix(docs): add information on missing cli command options --- docs/src/cli/generate.md | 4 ++++ docs/src/cli/highlight.md | 4 ++++ docs/src/cli/init.md | 4 ++++ docs/src/cli/parse.md | 8 ++++++++ docs/src/cli/query.md | 4 ++++ docs/src/cli/tags.md | 4 ++++ docs/src/cli/test.md | 8 ++++++++ docs/src/cli/version.md | 6 ++++++ 8 files changed, 42 insertions(+) diff --git a/docs/src/cli/generate.md b/docs/src/cli/generate.md index 3b2a94d3..26bc7e1e 100644 --- a/docs/src/cli/generate.md +++ b/docs/src/cli/generate.md @@ -56,6 +56,10 @@ Print the overview of states from the given rule. This is useful for debugging a item sets for all given states in a given rule. To solely view state count numbers for rules, pass in `-` for the rule argument. To view the overview of states for every rule, pass in `*` for the rule argument. +### `json` + +Report conflicts in a JSON format. + ### `--js-runtime ` The path to the JavaScript runtime executable to use when generating the parser. The default is `node`. diff --git a/docs/src/cli/highlight.md b/docs/src/cli/highlight.md index c5b3e8a3..1378e0f6 100644 --- a/docs/src/cli/highlight.md +++ b/docs/src/cli/highlight.md @@ -46,6 +46,10 @@ Suppress main output. The path to a file that contains paths to source files to highlight +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ### `--config-path ` The path to an alternative configuration (`config.json`) file. See [the init-config command](./init-config.md) for more information. diff --git a/docs/src/cli/init.md b/docs/src/cli/init.md index 2751b368..fd4c245e 100644 --- a/docs/src/cli/init.md +++ b/docs/src/cli/init.md @@ -14,6 +14,10 @@ tree-sitter init [OPTIONS] # Aliases: i Update outdated generated files, if needed. +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ## Structure of `tree-sitter.json` The main file of interest for users to configure is `tree-sitter.json`, which tells the CLI information about your grammar, diff --git a/docs/src/cli/parse.md b/docs/src/cli/parse.md index 97c6422a..04a13bb8 100644 --- a/docs/src/cli/parse.md +++ b/docs/src/cli/parse.md @@ -14,6 +14,10 @@ tree-sitter parse [OPTIONS] [PATHS]... # Aliases: p The path to a file that contains paths to source files to parse. +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ### `--scope ` The language scope to use for parsing. This is useful when the language is ambiguous. @@ -77,6 +81,10 @@ in `UTF-16BE` or `UTF-16LE`. If no `BOM` is present, `UTF-8` is the default. One When using the `--debug-graph` option, open the log file in the default browser. +### `-j/--json` + +Output parsing results in a JSON format. + ### `--config-path ` The path to an alternative configuration (`config.json`) file. See [the init-config command](./init-config.md) for more information. diff --git a/docs/src/cli/query.md b/docs/src/cli/query.md index cbfb445a..ed96aa51 100644 --- a/docs/src/cli/query.md +++ b/docs/src/cli/query.md @@ -8,6 +8,10 @@ tree-sitter query [OPTIONS] [PATHS]... # Aliases: q ## Options +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ### `-t/--time` Print the time taken to execute the query on the file. diff --git a/docs/src/cli/tags.md b/docs/src/cli/tags.md index 98e173c3..80ee1baa 100644 --- a/docs/src/cli/tags.md +++ b/docs/src/cli/tags.md @@ -25,6 +25,10 @@ Suppress main output. The path to a file that contains paths to source files to tag. +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ### `--config-path ` The path to an alternative configuration (`config.json`) file. See [the init-config command](./init-config.md) for more information. diff --git a/docs/src/cli/test.md b/docs/src/cli/test.md index ee82ee9b..f5b2f3f5 100644 --- a/docs/src/cli/test.md +++ b/docs/src/cli/test.md @@ -16,6 +16,14 @@ Only run tests whose names match this regex. Skip tests whose names match this regex. +### `--file-name ` + +Only run tests from the given filename in the corpus. + +### `-p/--grammar-path ` + +The path to the directory containing the grammar. + ### `-u/--update` Update the expected output of tests. diff --git a/docs/src/cli/version.md b/docs/src/cli/version.md index 464c98a4..94ec6282 100644 --- a/docs/src/cli/version.md +++ b/docs/src/cli/version.md @@ -22,3 +22,9 @@ different bindings. However, doing so manually is error-prone and tedious, so this command takes care of the burden. If you are using a version control system, it is recommended to commit the changes made by this command, and to tag the commit with the new version. + +## Options + +### `-p/--grammar-path ` + +The path to the directory containing the grammar.