Skip to content

Commit f722a37

Browse files
committed
jc: fix instructions and make it a module
1 parent 8cc78e8 commit f722a37

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

modules/jc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ automatically parses its output into a structured data format.
3030

3131
2. Source this module in your `config.nu`:
3232
```nu
33-
source ~/path/to/jc/mod.rs
33+
use modules/jc
3434
```

modules/jc/mod.nu

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
def --env "nu-complete jc" [] {
2-
if $env.__NU_COMPLETE_JC? != null {
3-
return $env.__NU_COMPLETE_JC
4-
}
5-
6-
let options = try {
2+
try {
73
let about = ^jc --about
84
| from json
95

@@ -38,14 +34,10 @@ def --env "nu-complete jc" [] {
3834
} catch {
3935
[]
4036
}
41-
42-
$env.__NU_COMPLETE_JC = $options
43-
44-
$options
4537
}
4638

4739
# Run `jc` (JSON Converter).
48-
export def --wrapped jc [...arguments: string@"nu-complete jc"]: [any -> table, any -> record, any -> string] {
40+
export def --wrapped main [...arguments: string@"nu-complete jc"]: [any -> table, any -> record, any -> string] {
4941
let run = ^jc ...$arguments | complete
5042

5143
if $run.exit_code != 0 {

0 commit comments

Comments
 (0)