Skip to content
Snippets Groups Projects
Commit 45540a7c authored by STEVAN Antoine's avatar STEVAN Antoine 🦀
Browse files

make `.nushell/` a proper module (dragoon/komodo!123)

this MR turns `./.nushell/` into a directory module by
- adding `mod.nu`
- exporting all the modules

all uses of `.nushell/` have been fixed to not mention `.nu` internal modules anymore.

> 💡 **Note**  
> the `.nushell venv` module has been removed because, when the `$venv.VENV` activation script is not there, Nushell can't parse the whole `.nushell` module, which is very annoying to have to rely of the state of the external filesystem to be able to simply parse a module...
parent f270ac3e
No related branches found
No related tags found
No related merge requests found
export module binary.nu
export module cargo.nu
export module color.nu
export module error.nu
export module formats.nu
export module fs.nu
export module math.nu
export module parse.nu
export module plot.nu
use venv.nu VENV
export const COMMON_OPTIONS = [
--x-scale log
--x-scale-base 2
......@@ -70,6 +68,5 @@ export def into-axis-options [-x: string, -y: string]: table<x: float, y: float>
}
export def --wrapped gplt [...args: string] {
overlay use $VENV
^gplt ...$args
}
export const VENV = ($nu.home-path | path join ".local/share/venvs/gplt/bin/activate.nu")
......@@ -25,7 +25,7 @@ Komodo provides a bunch of other binaries that might be interesting of useful to
The easiest is to use the `cargo.nu` Nushell module as follows
```bash
use .nushell/cargo.nu "cargo bin"
use .nushell cargo "cargo bin"
help cargo bin
```
......
use ../../../.nushell/math.nu *
use ../../../.nushell/fs.nu check-file
use ../../../.nushell/plot.nu [ into-axis-options, COMMON_OPTIONS, gplt ]
use ../../../.nushell math *
use ../../../.nushell fs check-file
use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] {
check-file $data --span (metadata $data).span
......
use ../../../.nushell/math.nu *
use ../../../.nushell/plot.nu [ into-axis-options, COMMON_OPTIONS ]
use ../../../.nushell/fs.nu check-file
use ../../../.nushell/plot.nu gplt
use ../../../.nushell math *
use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS ]
use ../../../.nushell fs check-file
use ../../../.nushell plot gplt
export def encoding [data: path, --save: path] {
check-file $data --span (metadata $data).span
......
use ../../../.nushell/formats.nu *
use ../../../.nushell formats *
export def main [
--output: path = "./fec.ndjson",
......
use ../../../.nushell/math.nu *
use ../../../.nushell/plot.nu [ into-axis-options, COMMON_OPTIONS ]
use ../../../.nushell/fs.nu check-file
use ../../../.nushell/plot.nu gplt
use ../../../.nushell math *
use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS ]
use ../../../.nushell fs check-file
use ../../../.nushell plot gplt
export def main [data: path, --save: path] {
check-file $data --span (metadata $data).span
......
use ../../../.nushell/formats.nu *
use ../../../.nushell formats *
export def main [
--output: path = "./recoding.ndjson",
......
use ../../../.nushell/math.nu *
use ../../../.nushell/fs.nu check-file
use ../../../.nushell/plot.nu [ into-axis-options, COMMON_OPTIONS, gplt ]
use ../../../.nushell math *
use ../../../.nushell fs check-file
use ../../../.nushell plot [ into-axis-options, COMMON_OPTIONS, gplt ]
export def main [data: path, --save: path] {
check-file $data --span (metadata $data).span
......
use std repeat
use consts.nu
use ../../.nushell/plot.nu gplt
use ../../.nushell/color.nu *
use ../../.nushell/error.nu "error throw"
use ../../.nushell plot gplt
use ../../.nushell color *
use ../../.nushell error "error throw"
def "parse strategy" []: string -> record<type: string> {
let s = $in
......
use consts.nu
use ../../.nushell/cargo.nu "cargo bin"
use ../../.nushell cargo "cargo bin"
export def main [
--options: record<
......
......@@ -7,7 +7,7 @@ use ../komodo.nu [
"komodo reconstruct",
"komodo ls",
]
use ../.nushell/binary.nu [ "bytes from_int" ]
use ../.nushell binary [ "bytes from_int" ]
use std assert
......
......@@ -2,7 +2,7 @@
#
# please run `komodo --help` or `komodo <tab>` to have a look at more information
use .nushell/binary.nu ["bytes from_int"]
use .nushell binary ["bytes from_int"]
const KOMODO_BINARY = "./target/release/komodo"
const DEFAULT_LOG_LEVEL = "INFO"
......
use ../.nushell/binary.nu [
use ../.nushell binary [
"bytes decode", "bytes encode", "bytes from_int", "bytes to_int"
]
......
......@@ -7,7 +7,7 @@ use ../komodo.nu [
"komodo ls",
"komodo clean",
]
use ../.nushell/binary.nu [ "bytes from_int" ]
use ../.nushell binary [ "bytes from_int" ]
use std assert
......
use ../.nushell/color.nu [
use ../.nushell color [
"color from-floats",
"color from-ints",
"color from-string",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment