Skip to content

Commit effb2eb

Browse files
fix: rename command part 4
1 parent 275575d commit effb2eb

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

website/advanced/match-algorithm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,12 @@ The table below summarize how nodes are skipped during matching.
129129

130130
ast-grep has two ways to configure pattern strictness.
131131

132-
1. Using `--strictness` in `sg run`
132+
1. Using `--strictness` in `ast-grep run`
133133

134-
You can use the `--strictness` flag in [`sg run`](/reference/cli/run.html)
134+
You can use the `--strictness` flag in [`ast-grep run`](/reference/cli/run.html)
135135

136136
```bash
137-
sg run -p '$FOO($BAR)' --strictness ast
137+
ast-grep run -p '$FOO($BAR)' --strictness ast
138138
```
139139

140140
2. Using `strictness` in Pattern Object

website/guide/quick-start.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ pip install ast-grep-cli
4545
```
4646
:::
4747

48-
The binary command, `sg`, or `ast-grep`, should be available now. Let's try it with `--help`.
48+
The binary command, `ast-grep` or `sg`, should be available now. Let's try it with `--help`.
4949

5050
```shell
51-
sg --help
52-
# if you are on Linux
5351
ast-grep --help
52+
# if you are not on Linux
53+
sg --help
5454
```
5555

5656
:::danger Use `sg` on Linux
5757
Linux has a default command `sg` for `setgroups`. You can use the full command name `ast-grep` instead of `sg`.
5858
You can also use shorter alias if you want by `alias sg=ast-grep`.
59-
We will use `sg` in the guide below.
59+
We will use `ast-grep` in the guide below.
6060
:::
6161

6262

@@ -103,22 +103,22 @@ Optionally, we can use `lang` to tell ast-grep our target code language.
103103

104104
:::code-group
105105
```shell [Full Command]
106-
sg --pattern '$PROP && $PROP()' --lang ts TypeScript/src
106+
ast-grep --pattern '$PROP && $PROP()' --lang ts TypeScript/src
107107
```
108108
```shell [Short Form]
109-
sg -p '$PROP && $PROP()' -l ts TypeScript/src
109+
ast-grep -p '$PROP && $PROP()' -l ts TypeScript/src
110110
```
111111
```shell [Without Lang]
112112
# ast-grep will infer languages based on file extensions
113-
sg -p '$PROP && $PROP()' TypeScript/src
113+
ast-grep -p '$PROP && $PROP()' TypeScript/src
114114
```
115115
:::
116116

117117
:::tip Pro Tip
118118
Pattern must be quoted by single quote `'` to prevent shell from interpreting `$` sign.
119-
`sg -p '$PROP && $PROP()'` is okay.
119+
`ast-grep -p '$PROP && $PROP()'` is okay.
120120

121-
But `sg -p "$PROP && $PROP()"` will be interpreted as `sg -p " && ()"` after shell expansion.
121+
But `ast-grep -p "$PROP && $PROP()"` will be interpreted as `ast-grep -p " && ()"` after shell expansion.
122122
:::
123123

124124
## Rewrite
@@ -127,7 +127,7 @@ Cool? Now we can use this pattern to refactor TypeScript source!
127127

128128
```shell
129129
# pattern and language argument support short form
130-
sg -p '$PROP && $PROP()' \
130+
ast-grep -p '$PROP && $PROP()' \
131131
--rewrite '$PROP?.()' \
132132
--interactive \
133133
-l ts \

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy