@optique/run 1.0.0-dev.688 → 1.0.0-dev.692
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 +20 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -40,7 +40,8 @@ Quick example
|
|
|
40
40
|
|
|
41
41
|
~~~~ typescript
|
|
42
42
|
import { run } from "@optique/run";
|
|
43
|
-
import {
|
|
43
|
+
import { option, argument } from "@optique/core/primitives";
|
|
44
|
+
import { object } from "@optique/core/constructs";
|
|
44
45
|
import { string, integer } from "@optique/core/valueparser";
|
|
45
46
|
|
|
46
47
|
const parser = object({
|
|
@@ -70,13 +71,14 @@ Verbose mode enabled.
|
|
|
70
71
|
Shell completion
|
|
71
72
|
----------------
|
|
72
73
|
|
|
73
|
-
*@optique/run* automatically supports shell completion for Bash
|
|
74
|
-
Enable completion by adding the `completion` option
|
|
75
|
-
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:
|
|
76
77
|
|
|
77
78
|
~~~~ typescript
|
|
78
79
|
import { run } from "@optique/run";
|
|
79
|
-
import {
|
|
80
|
+
import { option, argument } from "@optique/core/primitives";
|
|
81
|
+
import { object } from "@optique/core/constructs";
|
|
80
82
|
import { string, choice } from "@optique/core/valueparser";
|
|
81
83
|
|
|
82
84
|
const parser = object({
|
|
@@ -93,12 +95,23 @@ const config = run(parser, {
|
|
|
93
95
|
Users can then generate and install completion scripts:
|
|
94
96
|
|
|
95
97
|
~~~~ bash
|
|
96
|
-
#
|
|
98
|
+
# Bash
|
|
97
99
|
myapp completion bash > ~/.bashrc.d/myapp.bash
|
|
98
100
|
source ~/.bashrc.d/myapp.bash
|
|
99
101
|
|
|
100
|
-
#
|
|
102
|
+
# zsh
|
|
101
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
|
|
102
115
|
~~~~
|
|
103
116
|
|
|
104
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.692+2b267f09",
|
|
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.692+2b267f09"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/node": "^20.19.9",
|