bash-explainer 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/THIRD_PARTY_NOTICES.md +7 -7
- package/dist/cli.js +113 -111
- package/dist/tree-sitter-bash.wasm +0 -0
- package/dist/web-tree-sitter.wasm +0 -0
- package/package.json +1 -1
- package/dist/tree-sitter.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# bash-explainer
|
|
2
2
|
|
|
3
|
-
Explains shell scripts line by line in the terminal — every command, option, redirection and `${…}` — with worked examples. The command-line companion of the [Bash Explainer](https://marketplace.visualstudio.com/items?itemName=shun-fujioka.bash-explainer) VS Code extension, with the same explanations.
|
|
3
|
+
Explains shell scripts line by line in the terminal — every command, option, redirection and `${…}` — with worked examples, and points out common pitfalls (unquoted variables, `x = 1`, `for f in $(ls)`…). The command-line companion of the [Bash Explainer](https://marketplace.visualstudio.com/items?itemName=shun-fujioka.bash-explainer) VS Code extension, with the same explanations.
|
|
4
4
|
|
|
5
5
|
**Offline by design:** no network, no AI, no telemetry. English and Japanese.
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ bash-explainer deploy.sh:12 # one line (or deploy.sh:12-20)
|
|
|
34
34
|
bash-explainer -e 'cmd 2>&1 > out' # a command line
|
|
35
35
|
cat deploy.sh | bash-explainer - # standard input
|
|
36
36
|
bash-explainer Dockerfile # the shell code in Dockerfiles, Makefiles, CI YAML,
|
|
37
|
-
# package.json, Markdown and Python
|
|
37
|
+
# Jenkinsfiles, package.json, Markdown and Python
|
|
38
38
|
bash-explainer --check install.sh # constructs its shell (#!/bin/sh: dash…) lacks
|
|
39
39
|
```
|
|
40
40
|
|
|
@@ -44,7 +44,7 @@ bash-explainer --check install.sh # constructs its shell (#!/bin/sh: dash…
|
|
|
44
44
|
| `-l`, `--line <n>[-<m>]` | only these lines |
|
|
45
45
|
| `--check` | report constructs the script's shell lacks, and other risks (script injection in GitHub Actions, Docker `RUN` pipes without `pipefail`…); exit 1 if there is a warning |
|
|
46
46
|
| `--shell <name>` | the script's shell: `bash`, `sh`, `dash`, `ash`, `yash`, `ksh`, `mksh`, `zsh` (default: from the shebang or the file name) |
|
|
47
|
-
| `--kind <kind>` | what the file is: `shell`, `dockerfile`, `makefile`, `yaml`, `npm`, `markdown`, `python` (default: from the file name) |
|
|
47
|
+
| `--kind <kind>` | what the file is: `shell`, `dockerfile`, `makefile`, `yaml`, `npm`, `markdown`, `python`, `jenkinsfile` (default: from the file name) |
|
|
48
48
|
| `--lang <en\|ja>` | language (default: from `LANG`) |
|
|
49
49
|
| `--format <format>` | `text`, `markdown` or `json`; with `--check`, also `github` (annotations in GitHub Actions) or `sarif` (for code scanning) |
|
|
50
50
|
| `--no-examples` | leave out worked examples |
|
|
@@ -72,7 +72,7 @@ Warnings appear on the pull request's diff, and fail the step (`fail-on-warning:
|
|
|
72
72
|
|
|
73
73
|
## In your editor (Language Server)
|
|
74
74
|
|
|
75
|
-
`bash-explainer --lsp` is a Language Server on standard input and output: hover a line for its explanation, and get the warnings with their quick fixes, in any editor that speaks LSP. It handles shell scripts (language IDs `sh`, `bash`, `zsh`, `shellscript`…) and the shell code in Dockerfiles, Makefiles, YAML, `package.json`, Markdown and
|
|
75
|
+
`bash-explainer --lsp` is a Language Server on standard input and output: hover a line for its explanation, and get the warnings with their quick fixes, in any editor that speaks LSP. It handles shell scripts (language IDs `sh`, `bash`, `zsh`, `shellscript`…) and the shell code in Dockerfiles, Makefiles, YAML, `package.json`, Markdown, Python and Jenkinsfiles. It runs next to other servers, such as bash-language-server.
|
|
76
76
|
|
|
77
77
|
Install it with `npm install --global bash-explainer` (see [Installation](#installation)), so the editor does not wait for `npx`.
|
|
78
78
|
|
|
@@ -81,7 +81,7 @@ Install it with `npm install --global bash-explainer` (see [Installation](#insta
|
|
|
81
81
|
```lua
|
|
82
82
|
vim.lsp.config('bash_explainer', {
|
|
83
83
|
cmd = { 'bash-explainer', '--lsp' },
|
|
84
|
-
filetypes = { 'sh', 'bash', 'zsh', 'dockerfile', 'make', 'yaml' },
|
|
84
|
+
filetypes = { 'sh', 'bash', 'zsh', 'dockerfile', 'make', 'yaml', 'groovy' },
|
|
85
85
|
root_markers = { '.git' },
|
|
86
86
|
-- init_options = { language = 'ja', shell = 'dash' },
|
|
87
87
|
})
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -8,8 +8,8 @@ Bash Explainer includes the following third-party software (MIT). Their license
|
|
|
8
8
|
|
|
9
9
|
| Component | Version | License | Included as |
|
|
10
10
|
| --- | --- | --- | --- |
|
|
11
|
-
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.
|
|
12
|
-
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter
|
|
11
|
+
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.25.1 | MIT | `dist/tree-sitter-bash.wasm` |
|
|
12
|
+
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) | 0.27.0 | MIT | bundled into `dist/extension.js`; bundled into `dist/web/extension.js`; `dist/web-tree-sitter.wasm` |
|
|
13
13
|
|
|
14
14
|
## In the web version
|
|
15
15
|
|
|
@@ -26,16 +26,16 @@ Bash Explainer includes the following third-party software (MIT). Their license
|
|
|
26
26
|
| [@marijn/find-cluster-break](https://code.haverbeke.berlin/marijn/find-cluster-break) | 1.0.4 | MIT | bundled into `app.js` |
|
|
27
27
|
| [crelt](https://code.haverbeke.berlin/marijn/crelt) | 1.0.7 | MIT | bundled into `app.js` |
|
|
28
28
|
| [style-mod](https://code.haverbeke.berlin/marijn/style-mod) | 4.1.4 | MIT | bundled into `app.js` |
|
|
29
|
-
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.
|
|
29
|
+
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.25.1 | MIT | `tree-sitter-bash.wasm` |
|
|
30
30
|
| [w3c-keyname](https://github.com/marijnh/w3c-keyname#readme) | 2.2.8 | MIT | bundled into `app.js` |
|
|
31
|
-
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter
|
|
31
|
+
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) | 0.27.0 | MIT | bundled into `app.js`; `web-tree-sitter.wasm` |
|
|
32
32
|
|
|
33
33
|
## In the command-line tool (npm package bash-explainer)
|
|
34
34
|
|
|
35
35
|
| Component | Version | License | Included as |
|
|
36
36
|
| --- | --- | --- | --- |
|
|
37
|
-
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.
|
|
38
|
-
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter
|
|
37
|
+
| [tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash) | 0.25.1 | MIT | `dist/tree-sitter-bash.wasm` |
|
|
38
|
+
| [web-tree-sitter](https://github.com/tree-sitter/tree-sitter) | 0.27.0 | MIT | bundled into `dist/cli.js`; `dist/web-tree-sitter.wasm` |
|
|
39
39
|
|
|
40
40
|
## License texts
|
|
41
41
|
|
|
@@ -220,7 +220,7 @@ THE SOFTWARE.
|
|
|
220
220
|
```text
|
|
221
221
|
The MIT License (MIT)
|
|
222
222
|
|
|
223
|
-
Copyright (c) 2018
|
|
223
|
+
Copyright (c) 2018 Max Brunsfeld
|
|
224
224
|
|
|
225
225
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
226
226
|
of this software and associated documentation files (the "Software"), to deal
|