@optique/run 1.0.0-dev.690 → 1.0.0-dev.693
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 +17 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,9 +71,9 @@ Verbose mode enabled.
|
|
|
71
71
|
Shell completion
|
|
72
72
|
----------------
|
|
73
73
|
|
|
74
|
-
*@optique/run* automatically supports shell completion for Bash
|
|
75
|
-
Enable completion by adding the `completion` option
|
|
76
|
-
configuration:
|
|
74
|
+
*@optique/run* automatically supports shell completion for Bash, zsh, fish,
|
|
75
|
+
PowerShell, and Nushell. Enable completion by adding the `completion` option
|
|
76
|
+
to your `run()` configuration:
|
|
77
77
|
|
|
78
78
|
~~~~ typescript
|
|
79
79
|
import { run } from "@optique/run";
|
|
@@ -88,19 +88,30 @@ const parser = object({
|
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
const config = run(parser, {
|
|
91
|
-
completion:
|
|
91
|
+
completion: "both"
|
|
92
92
|
});
|
|
93
93
|
~~~~
|
|
94
94
|
|
|
95
95
|
Users can then generate and install completion scripts:
|
|
96
96
|
|
|
97
97
|
~~~~ bash
|
|
98
|
-
#
|
|
98
|
+
# Bash
|
|
99
99
|
myapp completion bash > ~/.bashrc.d/myapp.bash
|
|
100
100
|
source ~/.bashrc.d/myapp.bash
|
|
101
101
|
|
|
102
|
-
#
|
|
102
|
+
# zsh
|
|
103
103
|
myapp completion zsh > ~/.zsh/completions/_myapp
|
|
104
|
+
|
|
105
|
+
# fish
|
|
106
|
+
myapp completion fish > ~/.config/fish/completions/myapp.fish
|
|
107
|
+
|
|
108
|
+
# PowerShell
|
|
109
|
+
myapp completion pwsh > myapp-completion.ps1
|
|
110
|
+
. ./myapp-completion.ps1
|
|
111
|
+
|
|
112
|
+
# Nushell
|
|
113
|
+
myapp completion nu | save myapp-completion.nu
|
|
114
|
+
source myapp-completion.nu
|
|
104
115
|
~~~~
|
|
105
116
|
|
|
106
117
|
The completion system automatically provides intelligent suggestions for:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/run",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.693+6ee99e0d",
|
|
4
4
|
"description": "Type-safe combinatorial command-line interface parser",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"sideEffects": false,
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@optique/core": "1.0.0-dev.
|
|
73
|
+
"@optique/core": "1.0.0-dev.693+6ee99e0d"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|