feat(nu): Make the completion scripts more general

The generated scripts can be used as script, module and overlay.

* script
  `source completion_script.nu`

* module
  `use completion_script.nu *`

* overlay
  `overlay use completion_script.nu`
This commit is contained in:
nibon7 2023-09-11 17:40:59 +08:00
parent 6eac61154b
commit 45a7c2e37e
No known key found for this signature in database
GPG key ID: 281CE465D8EEC03B
9 changed files with 9 additions and 9 deletions

View file

@ -42,7 +42,7 @@ impl Generator for Nushell {
}
completions.push_str("}\n\n");
completions.push_str("use completions *\n");
completions.push_str("export use completions *\n");
buf.write_all(completions.as_bytes())
.expect("Failed to write to generated file")

View file

@ -15,4 +15,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -27,4 +27,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -36,4 +36,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -255,4 +255,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -75,4 +75,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -64,4 +64,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -73,4 +73,4 @@ module completions {
}
use completions *
export use completions *

View file

@ -24,4 +24,4 @@ module completions {
}
use completions *
export use completions *