diff --git a/modules/jc/README.md b/modules/jc/README.md index a26c442..64914a9 100644 --- a/modules/jc/README.md +++ b/modules/jc/README.md @@ -30,5 +30,5 @@ automatically parses its output into a structured data format. 2. Source this module in your `config.nu`: ```nu - source ~/path/to/jc/mod.rs + use modules/jc ``` diff --git a/modules/jc/mod.nu b/modules/jc/mod.nu index 2f56187..4e8a497 100644 --- a/modules/jc/mod.nu +++ b/modules/jc/mod.nu @@ -1,9 +1,5 @@ def --env "nu-complete jc" [] { - if $env.__NU_COMPLETE_JC? != null { - return $env.__NU_COMPLETE_JC - } - - let options = try { + try { let about = ^jc --about | from json @@ -38,14 +34,10 @@ def --env "nu-complete jc" [] { } catch { [] } - - $env.__NU_COMPLETE_JC = $options - - $options } # Run `jc` (JSON Converter). -export def --wrapped jc [...arguments: string@"nu-complete jc"]: [any -> table, any -> record, any -> string] { +export def --wrapped main [...arguments: string@"nu-complete jc"]: [any -> table, any -> record, any -> string] { let run = ^jc ...$arguments | complete if $run.exit_code != 0 {