Skip to content

Commit 361287f

Browse files
WillLillisclason
authored andcommitted
fix(cli)!: deprecate --build flag for generate command
1 parent 13d4db8 commit 361287f

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

crates/cli/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ struct Generate {
114114
/// Only generate `grammar.json` and `node-types.json`
115115
#[arg(long)]
116116
pub no_parser: bool,
117-
/// Compile all defined languages in the current dir
117+
/// Deprecated: use the `build` command
118118
#[arg(long, short = 'b')]
119119
pub build: bool,
120-
/// Compile a parser in debug mode
120+
/// Deprecated: use the `build` command
121121
#[arg(long, short = '0')]
122122
pub debug_build: bool,
123-
/// The path to the directory containing the parser library
123+
/// Deprecated: use the `build` command
124124
#[arg(long, value_name = "PATH")]
125125
pub libdir: Option<PathBuf>,
126126
/// The path to output the generated source files
@@ -905,6 +905,7 @@ impl Generate {
905905
}
906906
}
907907
if self.build {
908+
warn!("--build is deprecated, use the `build` command");
908909
if let Some(path) = self.libdir {
909910
loader = loader::Loader::with_parser_lib_path(path);
910911
}

docs/src/cli/generate.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ The ABI to use for parser generation. The default is ABI 15, with ABI 14 being a
3434

3535
Only generate `grammar.json` and `node-types.json`
3636

37-
### `-0/--debug-build`
38-
39-
Compile the parser with debug flags enabled. This is useful when debugging issues that require a debugger like `gdb` or `lldb`.
40-
41-
### `--libdir <PATH>`
42-
43-
The directory to place the compiled parser(s) in.
44-
On Unix systems, the default path is `$XDG_CACHE_HOME/tree-sitter` if `$XDG_CACHE_HOME` is set,
45-
otherwise `$HOME/.config/tree-sitter` is used. On Windows, the default path is `%LOCALAPPDATA%\tree-sitter` if available,
46-
otherwise `$HOME\AppData\Local\tree-sitter` is used.
47-
4837
### `-o/--output`
4938

5039
The directory to place the generated parser in. The default is `src/` in the current directory.

0 commit comments

Comments
 (0)