mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
Compare commits
56 Commits
0.88.1
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
4dbe3ecfe2 | |||
7ad0e5541e | |||
c1cc1c82cc | |||
b0b4c3dffd | |||
f3de373c59 | |||
df1fecd2cb | |||
9620e27e4f | |||
072ecec8ca | |||
748d82cec1 | |||
5e5d1ea81b | |||
bb570e42be | |||
3a050864df | |||
8cfa96b4c0 | |||
6f384da57e | |||
f8e63328d8 | |||
5d98a727ca | |||
109f629cb6 | |||
ff6a67d293 | |||
03ae01f11e | |||
697f3c03f1 | |||
1cecb37628 | |||
89436e978b | |||
cd0a52cf00 | |||
c6043eb500 | |||
729373aba0 | |||
f59a6990dc | |||
0f9094ead2 | |||
70f7db14d4 | |||
0cba269d80 | |||
ec2593efb8 | |||
c2283596ac | |||
c9399f5142 | |||
c9c93f5b4d | |||
2264682443 | |||
247c33b6d6 | |||
a6da8ce769 | |||
020e121391 | |||
7d5bd0d6be | |||
87717b9ddd | |||
3c6fac059e | |||
9092fc1b12 | |||
5b557a888e | |||
398b756aee | |||
533c1a89af | |||
84742275a1 | |||
92d968b8c8 | |||
50102bf69b | |||
156232fe08 | |||
0a3761a594 | |||
44dc890124 | |||
6ead98effb | |||
d5f76c02f0 | |||
fd77114d82 | |||
78f52e8b66 | |||
5b01685fc3 | |||
c2b684464f |
35
.github/workflows/ci.yml
vendored
35
.github/workflows/ci.yml
vendored
@ -92,6 +92,17 @@ jobs:
|
|||||||
- name: Tests
|
- name: Tests
|
||||||
run: cargo test --workspace --profile ci --exclude nu_plugin_* ${{ matrix.flags }}
|
run: cargo test --workspace --profile ci --exclude nu_plugin_* ${{ matrix.flags }}
|
||||||
|
|
||||||
|
- name: Check for clean repo
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "there are changes";
|
||||||
|
git status --porcelain
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "no changes in working directory";
|
||||||
|
fi
|
||||||
|
|
||||||
std-lib-and-python-virtualenv:
|
std-lib-and-python-virtualenv:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@ -117,7 +128,7 @@ jobs:
|
|||||||
run: nu -c 'use std testing; testing run-tests --path crates/nu-std'
|
run: nu -c 'use std testing; testing run-tests --path crates/nu-std'
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
|
|
||||||
@ -129,6 +140,17 @@ jobs:
|
|||||||
run: nu scripts/test_virtualenv.nu
|
run: nu scripts/test_virtualenv.nu
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
|
- name: Check for clean repo
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "there are changes";
|
||||||
|
git status --porcelain
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "no changes in working directory";
|
||||||
|
fi
|
||||||
|
|
||||||
plugins:
|
plugins:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
@ -150,3 +172,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Tests
|
- name: Tests
|
||||||
run: cargo test --profile ci --package nu_plugin_*
|
run: cargo test --profile ci --package nu_plugin_*
|
||||||
|
|
||||||
|
- name: Check for clean repo
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "there are changes";
|
||||||
|
git status --porcelain
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
echo "no changes in working directory";
|
||||||
|
fi
|
||||||
|
2
.github/workflows/typos.yml
vendored
2
.github/workflows/typos.yml
vendored
@ -10,6 +10,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Check spelling
|
- name: Check spelling
|
||||||
uses: crate-ci/typos@v1.16.23
|
uses: crate-ci/typos@v1.16.25
|
||||||
with:
|
with:
|
||||||
config: ./.github/.typos.toml
|
config: ./.github/.typos.toml
|
||||||
|
309
Cargo.lock
generated
309
Cargo.lock
generated
@ -114,9 +114,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstream"
|
name = "anstream"
|
||||||
version = "0.6.4"
|
version = "0.6.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
|
checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anstyle",
|
"anstyle",
|
||||||
"anstyle-parse",
|
"anstyle-parse",
|
||||||
@ -143,9 +143,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anstyle-query"
|
name = "anstyle-query"
|
||||||
version = "1.0.1"
|
version = "1.0.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748"
|
checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-sys 0.52.0",
|
"windows-sys 0.52.0",
|
||||||
]
|
]
|
||||||
@ -241,7 +241,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -252,7 +252,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -352,7 +352,7 @@ dependencies = [
|
|||||||
"regex",
|
"regex",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"shlex",
|
"shlex",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -471,7 +471,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -974,7 +974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
|
checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1196,7 +1196,7 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1217,9 +1217,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "erased-serde"
|
name = "erased-serde"
|
||||||
version = "0.3.31"
|
version = "0.4.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c"
|
checksum = "a3286168faae03a0e583f6fde17c02c8b8bba2dcc2061d0f7817066e5b0af706"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
@ -1252,16 +1252,6 @@ version = "0.1.9"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
|
checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "fancy-regex"
|
|
||||||
version = "0.11.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2"
|
|
||||||
dependencies = [
|
|
||||||
"bit-set",
|
|
||||||
"regex",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fancy-regex"
|
name = "fancy-regex"
|
||||||
version = "0.12.0"
|
version = "0.12.0"
|
||||||
@ -1291,7 +1281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5"
|
checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1461,7 +1451,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1730,9 +1720,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "http-body"
|
name = "http-body"
|
||||||
version = "0.4.5"
|
version = "0.4.6"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
|
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes",
|
"bytes",
|
||||||
"http",
|
"http",
|
||||||
@ -1798,7 +1788,7 @@ dependencies = [
|
|||||||
"iana-time-zone-haiku",
|
"iana-time-zone-haiku",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"windows-core",
|
"windows-core 0.51.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1921,7 +1911,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hermit-abi",
|
"hermit-abi",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1975,10 +1965,19 @@ dependencies = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itoa"
|
name = "itertools"
|
||||||
version = "1.0.9"
|
version = "0.12.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
|
checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itoa"
|
||||||
|
version = "1.0.10"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "jobserver"
|
name = "jobserver"
|
||||||
@ -2102,9 +2101,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.150"
|
version = "0.2.151"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libflate"
|
name = "libflate"
|
||||||
@ -2273,9 +2272,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lscolors"
|
name = "lscolors"
|
||||||
version = "0.15.0"
|
version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bf7015a04103ad78abb77e4b79ed151e767922d1cfde5f62640471c629a2320d"
|
checksum = "ab0b209ec3976527806024406fe765474b9a1750a0ed4b8f0372364741f50e7b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
]
|
]
|
||||||
@ -2424,7 +2423,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2469,9 +2468,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mio"
|
name = "mio"
|
||||||
version = "0.8.9"
|
version = "0.8.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0"
|
checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
@ -2616,7 +2615,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu"
|
name = "nu"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert_cmd",
|
"assert_cmd",
|
||||||
"criterion",
|
"criterion",
|
||||||
@ -2673,11 +2672,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-cli"
|
name = "nu-cli"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"fuzzy-matcher",
|
"fuzzy-matcher",
|
||||||
"is_executable",
|
"is_executable",
|
||||||
"log",
|
"log",
|
||||||
@ -2706,7 +2705,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-cmd-base"
|
name = "nu-cmd-base"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"miette",
|
"miette",
|
||||||
@ -2722,11 +2721,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-cmd-dataframe"
|
name = "nu-cmd-dataframe"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"chrono-tz",
|
"chrono-tz",
|
||||||
"fancy-regex 0.12.0",
|
"fancy-regex",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"nu-cmd-lang",
|
"nu-cmd-lang",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -2740,15 +2739,15 @@ dependencies = [
|
|||||||
"polars-ops",
|
"polars-ops",
|
||||||
"polars-plan",
|
"polars-plan",
|
||||||
"serde",
|
"serde",
|
||||||
"sqlparser",
|
"sqlparser 0.41.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-cmd-extra"
|
name = "nu-cmd-extra"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ahash",
|
"ahash",
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"heck",
|
"heck",
|
||||||
"htmlescape",
|
"htmlescape",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
@ -2770,10 +2769,10 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-cmd-lang"
|
name = "nu-cmd-lang"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"itertools 0.11.0",
|
"itertools 0.12.0",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
"nu-parser",
|
"nu-parser",
|
||||||
@ -2784,7 +2783,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-color-config"
|
name = "nu-color-config"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -2797,7 +2796,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-command"
|
name = "nu-command"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"alphanumeric-sort",
|
"alphanumeric-sort",
|
||||||
"base64 0.21.5",
|
"base64 0.21.5",
|
||||||
@ -2816,7 +2815,7 @@ dependencies = [
|
|||||||
"dirs-next",
|
"dirs-next",
|
||||||
"dtparse",
|
"dtparse",
|
||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"filesize",
|
"filesize",
|
||||||
"filetime",
|
"filetime",
|
||||||
"fs_extra",
|
"fs_extra",
|
||||||
@ -2824,7 +2823,7 @@ dependencies = [
|
|||||||
"human-date-parser",
|
"human-date-parser",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"indicatif",
|
"indicatif",
|
||||||
"itertools 0.11.0",
|
"itertools 0.12.0",
|
||||||
"libc",
|
"libc",
|
||||||
"log",
|
"log",
|
||||||
"lscolors",
|
"lscolors",
|
||||||
@ -2894,13 +2893,13 @@ dependencies = [
|
|||||||
"uuid",
|
"uuid",
|
||||||
"wax",
|
"wax",
|
||||||
"which 5.0.0",
|
"which 5.0.0",
|
||||||
"windows 0.48.0",
|
"windows 0.52.0",
|
||||||
"winreg",
|
"winreg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-engine"
|
name = "nu-engine"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-glob",
|
"nu-glob",
|
||||||
"nu-path",
|
"nu-path",
|
||||||
@ -2910,7 +2909,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-explore"
|
name = "nu-explore"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi-str",
|
"ansi-str",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
@ -2931,14 +2930,14 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-glob"
|
name = "nu-glob"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"doc-comment",
|
"doc-comment",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-json"
|
name = "nu-json"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"linked-hash-map",
|
"linked-hash-map",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
@ -2947,7 +2946,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-lsp"
|
name = "nu-lsp"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"assert-json-diff",
|
"assert-json-diff",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
@ -2969,11 +2968,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-parser"
|
name = "nu-parser"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytesize",
|
"bytesize",
|
||||||
"chrono",
|
"chrono",
|
||||||
"itertools 0.11.0",
|
"itertools 0.12.0",
|
||||||
"log",
|
"log",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
"nu-path",
|
"nu-path",
|
||||||
@ -2985,7 +2984,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-path"
|
name = "nu-path"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dirs-next",
|
"dirs-next",
|
||||||
"omnipath",
|
"omnipath",
|
||||||
@ -2994,7 +2993,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-plugin"
|
name = "nu-plugin"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bincode",
|
"bincode",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -3006,7 +3005,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-pretty-hex"
|
name = "nu-pretty-hex"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"heapless",
|
"heapless",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
@ -3015,12 +3014,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-protocol"
|
name = "nu-protocol"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byte-unit",
|
"byte-unit",
|
||||||
"chrono",
|
"chrono",
|
||||||
"chrono-humanize",
|
"chrono-humanize",
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"lru",
|
"lru",
|
||||||
"miette",
|
"miette",
|
||||||
@ -3040,7 +3039,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-std"
|
name = "nu-std"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"miette",
|
"miette",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -3050,7 +3049,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-system"
|
name = "nu-system"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"libc",
|
"libc",
|
||||||
@ -3067,9 +3066,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-table"
|
name = "nu-table"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fancy-regex 0.11.0",
|
"fancy-regex",
|
||||||
"nu-ansi-term",
|
"nu-ansi-term",
|
||||||
"nu-color-config",
|
"nu-color-config",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -3081,7 +3080,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-term-grid"
|
name = "nu-term-grid"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-utils",
|
"nu-utils",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
@ -3089,7 +3088,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-test-support"
|
name = "nu-test-support"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hamcrest2",
|
"hamcrest2",
|
||||||
"nu-glob",
|
"nu-glob",
|
||||||
@ -3102,7 +3101,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu-utils"
|
name = "nu-utils"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crossterm_winapi",
|
"crossterm_winapi",
|
||||||
"log",
|
"log",
|
||||||
@ -3125,7 +3124,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu_plugin_example"
|
name = "nu_plugin_example"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-plugin",
|
"nu-plugin",
|
||||||
"nu-protocol",
|
"nu-protocol",
|
||||||
@ -3133,7 +3132,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu_plugin_formats"
|
name = "nu_plugin_formats"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"eml-parser",
|
"eml-parser",
|
||||||
"ical",
|
"ical",
|
||||||
@ -3145,7 +3144,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu_plugin_gstat"
|
name = "nu_plugin_gstat"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"git2",
|
"git2",
|
||||||
"nu-plugin",
|
"nu-plugin",
|
||||||
@ -3154,7 +3153,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu_plugin_inc"
|
name = "nu_plugin_inc"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"nu-plugin",
|
"nu-plugin",
|
||||||
"nu-protocol",
|
"nu-protocol",
|
||||||
@ -3163,7 +3162,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nu_plugin_query"
|
name = "nu_plugin_query"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gjson",
|
"gjson",
|
||||||
"nu-engine",
|
"nu-engine",
|
||||||
@ -3359,9 +3358,9 @@ checksum = "80adb31078122c880307e9cdfd4e3361e6545c319f9b9dcafcb03acd3b51a575"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.18.0"
|
version = "1.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
|
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "oorandom"
|
name = "oorandom"
|
||||||
@ -3403,7 +3402,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3585,7 +3584,7 @@ dependencies = [
|
|||||||
"pest_meta",
|
"pest_meta",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3668,7 +3667,7 @@ dependencies = [
|
|||||||
"phf_shared 0.11.2",
|
"phf_shared 0.11.2",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4052,7 +4051,7 @@ dependencies = [
|
|||||||
"rand",
|
"rand",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sqlparser",
|
"sqlparser 0.39.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4105,9 +4104,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "portable-atomic"
|
name = "portable-atomic"
|
||||||
version = "1.5.1"
|
version = "1.6.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b"
|
checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
@ -4195,7 +4194,7 @@ dependencies = [
|
|||||||
"hex",
|
"hex",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"procfs-core",
|
"procfs-core",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4392,9 +4391,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "reedline"
|
name = "reedline"
|
||||||
version = "0.27.0"
|
version = "0.27.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/nushell/reedline.git?branch=main#e097b88dab538705c7b165cf3a1f5cf3a74a23bb"
|
||||||
checksum = "147452ce32c2cba4900b410f1d18b9ca29b67301a8eed76676e42e720d71cc39"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"crossterm",
|
"crossterm",
|
||||||
@ -4429,7 +4427,7 @@ checksum = "7f7473c2cfcf90008193dd0e3e16599455cb601a9fce322b5bb55de799664925"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4553,7 +4551,7 @@ dependencies = [
|
|||||||
"regex",
|
"regex",
|
||||||
"relative-path",
|
"relative-path",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -4573,9 +4571,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rust-embed"
|
name = "rust-embed"
|
||||||
version = "8.0.0"
|
version = "8.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b1e7d90385b59f0a6bf3d3b757f3ca4ece2048265d70db20a2016043d4509a40"
|
checksum = "810294a8a4a0853d4118e3b94bb079905f2107c7fe979d8f0faae98765eb6378"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rust-embed-impl",
|
"rust-embed-impl",
|
||||||
"rust-embed-utils",
|
"rust-embed-utils",
|
||||||
@ -4584,22 +4582,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rust-embed-impl"
|
name = "rust-embed-impl"
|
||||||
version = "8.0.0"
|
version = "8.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3c3d8c6fd84090ae348e63a84336b112b5c3918b3bf0493a581f7bd8ee623c29"
|
checksum = "bfc144a1273124a67b8c1d7cd19f5695d1878b31569c0512f6086f0f4676604e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rust-embed-utils",
|
"rust-embed-utils",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rust-embed-utils"
|
name = "rust-embed-utils"
|
||||||
version = "8.0.0"
|
version = "8.1.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "873feff8cb7bf86fdf0a71bb21c95159f4e4a37dd7a4bd1855a940909b583ada"
|
checksum = "816ccd4875431253d6bb54b804bcff4369cbde9bae33defde25fdf6c2ef91d40"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"sha2",
|
"sha2",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
@ -4662,9 +4660,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustix"
|
name = "rustix"
|
||||||
version = "0.38.26"
|
version = "0.38.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a"
|
checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.1",
|
"bitflags 2.4.1",
|
||||||
"errno",
|
"errno",
|
||||||
@ -4681,9 +4679,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.15"
|
version = "1.0.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
|
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
@ -4795,7 +4793,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4817,7 +4815,7 @@ checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4876,7 +4874,7 @@ checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4901,9 +4899,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "shadow-rs"
|
name = "shadow-rs"
|
||||||
version = "0.24.1"
|
version = "0.25.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f9198caff1c94f1a5df6664bddbc379896b51b98a55b0b3fedcb23078fe00c77"
|
checksum = "615d846f7174a0850dca101bca72f6913e3376a64c5fda2b965d7fc3d1ff60cb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"is_debug",
|
"is_debug",
|
||||||
@ -5076,6 +5074,15 @@ dependencies = [
|
|||||||
"log",
|
"log",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sqlparser"
|
||||||
|
version = "0.41.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5cc2c25a6c66789625ef164b4c7d2e548d627902280c13710d33da8222169964"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stable_deref_trait"
|
name = "stable_deref_trait"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@ -5188,7 +5195,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5253,9 +5260,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.39"
|
version = "2.0.40"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
|
checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -5313,7 +5320,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fastrand",
|
"fastrand",
|
||||||
"redox_syscall",
|
"redox_syscall",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -5363,7 +5370,7 @@ version = "0.3.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"
|
checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -5401,7 +5408,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5492,9 +5499,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.34.0"
|
version = "1.35.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9"
|
checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
@ -5517,7 +5524,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5636,9 +5643,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "try-lock"
|
name = "try-lock"
|
||||||
version = "0.2.4"
|
version = "0.2.5"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed"
|
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typed-arena"
|
name = "typed-arena"
|
||||||
@ -5654,9 +5661,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typetag"
|
name = "typetag"
|
||||||
version = "0.2.13"
|
version = "0.2.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "80960fd143d4c96275c0e60b08f14b81fbb468e79bc0ef8fbda69fb0afafae43"
|
checksum = "196976efd4a62737b3a2b662cda76efb448d099b1049613d7a5d72743c611ce0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"erased-serde",
|
"erased-serde",
|
||||||
"inventory",
|
"inventory",
|
||||||
@ -5667,13 +5674,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typetag-impl"
|
name = "typetag-impl"
|
||||||
version = "0.2.13"
|
version = "0.2.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bfc13d450dc4a695200da3074dacf43d449b968baee95e341920e47f61a3b40f"
|
checksum = "2eea6765137e2414c44c7b1e07c73965a118a72c46148e1e168b3fc9d3ccf3aa"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -5702,9 +5709,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-bidi"
|
name = "unicode-bidi"
|
||||||
version = "0.3.13"
|
version = "0.3.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460"
|
checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-ident"
|
name = "unicode-ident"
|
||||||
@ -5747,9 +5754,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsafe-libyaml"
|
name = "unsafe-libyaml"
|
||||||
version = "0.2.9"
|
version = "0.2.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa"
|
checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ureq"
|
name = "ureq"
|
||||||
@ -6004,7 +6011,7 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -6026,7 +6033,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
@ -6071,7 +6078,7 @@ dependencies = [
|
|||||||
"either",
|
"either",
|
||||||
"home",
|
"home",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6083,7 +6090,7 @@ dependencies = [
|
|||||||
"either",
|
"either",
|
||||||
"home",
|
"home",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 0.38.26",
|
"rustix 0.38.28",
|
||||||
"windows-sys 0.48.0",
|
"windows-sys 0.48.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -6138,11 +6145,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows"
|
name = "windows"
|
||||||
version = "0.48.0"
|
version = "0.52.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
|
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-targets 0.48.5",
|
"windows-core 0.52.0",
|
||||||
|
"windows-targets 0.52.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6154,6 +6162,15 @@ dependencies = [
|
|||||||
"windows-targets 0.48.5",
|
"windows-targets 0.48.5",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-core"
|
||||||
|
version = "0.52.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets 0.52.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.45.0"
|
version = "0.45.0"
|
||||||
@ -6354,9 +6371,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winnow"
|
name = "winnow"
|
||||||
version = "0.5.24"
|
version = "0.5.28"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0383266b19108dfc6314a56047aa545a1b4d1be60e799b4dbdd407b56402704b"
|
checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
@ -6383,11 +6400,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xattr"
|
name = "xattr"
|
||||||
version = "1.0.1"
|
version = "1.1.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985"
|
checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
|
"linux-raw-sys 0.4.12",
|
||||||
|
"rustix 0.38.28",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6410,22 +6429,22 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy"
|
name = "zerocopy"
|
||||||
version = "0.7.29"
|
version = "0.7.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5d075cf85bbb114e933343e087b92f2146bac0d55b534cbb8188becf0039948e"
|
checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"zerocopy-derive",
|
"zerocopy-derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zerocopy-derive"
|
name = "zerocopy-derive"
|
||||||
version = "0.7.29"
|
version = "0.7.31"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "86cd5ca076997b97ef09d3ad65efe811fa68c9e874cb636ccb211223a813b0c2"
|
checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.39",
|
"syn 2.0.40",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
55
Cargo.toml
55
Cargo.toml
@ -11,7 +11,7 @@ license = "MIT"
|
|||||||
name = "nu"
|
name = "nu"
|
||||||
repository = "https://github.com/nushell/nushell"
|
repository = "https://github.com/nushell/nushell"
|
||||||
rust-version = "1.72.1"
|
rust-version = "1.72.1"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@ -33,7 +33,11 @@ members = [
|
|||||||
"crates/nu-cmd-lang",
|
"crates/nu-cmd-lang",
|
||||||
"crates/nu-cmd-dataframe",
|
"crates/nu-cmd-dataframe",
|
||||||
"crates/nu-command",
|
"crates/nu-command",
|
||||||
|
"crates/nu-color-config",
|
||||||
|
"crates/nu-explore",
|
||||||
|
"crates/nu-json",
|
||||||
"crates/nu-lsp",
|
"crates/nu-lsp",
|
||||||
|
"crates/nu-pretty-hex",
|
||||||
"crates/nu-protocol",
|
"crates/nu-protocol",
|
||||||
"crates/nu-plugin",
|
"crates/nu-plugin",
|
||||||
"crates/nu_plugin_inc",
|
"crates/nu_plugin_inc",
|
||||||
@ -43,31 +47,34 @@ members = [
|
|||||||
"crates/nu_plugin_custom_values",
|
"crates/nu_plugin_custom_values",
|
||||||
"crates/nu_plugin_formats",
|
"crates/nu_plugin_formats",
|
||||||
"crates/nu-std",
|
"crates/nu-std",
|
||||||
|
"crates/nu-table",
|
||||||
|
"crates/nu-term-grid",
|
||||||
"crates/nu-utils",
|
"crates/nu-utils",
|
||||||
]
|
]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-cli = { path = "./crates/nu-cli", version = "0.88.1" }
|
nu-cli = { path = "./crates/nu-cli", version = "0.88.2" }
|
||||||
nu-color-config = { path = "./crates/nu-color-config", version = "0.88.1" }
|
nu-color-config = { path = "./crates/nu-color-config", version = "0.88.2" }
|
||||||
nu-cmd-base = { path = "./crates/nu-cmd-base", version = "0.88.1" }
|
nu-cmd-base = { path = "./crates/nu-cmd-base", version = "0.88.2" }
|
||||||
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.88.1" }
|
nu-cmd-lang = { path = "./crates/nu-cmd-lang", version = "0.88.2" }
|
||||||
nu-cmd-dataframe = { path = "./crates/nu-cmd-dataframe", version = "0.88.1", features = ["dataframe"], optional = true }
|
nu-cmd-dataframe = { path = "./crates/nu-cmd-dataframe", version = "0.88.2", features = ["dataframe"], optional = true }
|
||||||
nu-cmd-extra = { path = "./crates/nu-cmd-extra", version = "0.88.1", optional = true }
|
nu-cmd-extra = { path = "./crates/nu-cmd-extra", version = "0.88.2", optional = true }
|
||||||
nu-command = { path = "./crates/nu-command", version = "0.88.1" }
|
nu-command = { path = "./crates/nu-command", version = "0.88.2" }
|
||||||
nu-engine = { path = "./crates/nu-engine", version = "0.88.1" }
|
nu-engine = { path = "./crates/nu-engine", version = "0.88.2" }
|
||||||
nu-explore = { path = "./crates/nu-explore", version = "0.88.1" }
|
nu-explore = { path = "./crates/nu-explore", version = "0.88.2" }
|
||||||
nu-json = { path = "./crates/nu-json", version = "0.88.1" }
|
nu-json = { path = "./crates/nu-json", version = "0.88.2" }
|
||||||
nu-lsp = { path = "./crates/nu-lsp/", version = "0.88.1" }
|
nu-lsp = { path = "./crates/nu-lsp/", version = "0.88.2" }
|
||||||
nu-parser = { path = "./crates/nu-parser", version = "0.88.1" }
|
nu-parser = { path = "./crates/nu-parser", version = "0.88.2" }
|
||||||
nu-path = { path = "./crates/nu-path", version = "0.88.1" }
|
nu-path = { path = "./crates/nu-path", version = "0.88.2" }
|
||||||
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.88.1" }
|
nu-plugin = { path = "./crates/nu-plugin", optional = true, version = "0.88.2" }
|
||||||
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.88.1" }
|
nu-pretty-hex = { path = "./crates/nu-pretty-hex", version = "0.88.2" }
|
||||||
nu-protocol = { path = "./crates/nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "./crates/nu-protocol", version = "0.88.2" }
|
||||||
nu-system = { path = "./crates/nu-system", version = "0.88.1" }
|
nu-system = { path = "./crates/nu-system", version = "0.88.2" }
|
||||||
nu-table = { path = "./crates/nu-table", version = "0.88.1" }
|
nu-table = { path = "./crates/nu-table", version = "0.88.2" }
|
||||||
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.88.1" }
|
nu-term-grid = { path = "./crates/nu-term-grid", version = "0.88.2" }
|
||||||
nu-std = { path = "./crates/nu-std", version = "0.88.1" }
|
nu-std = { path = "./crates/nu-std", version = "0.88.2" }
|
||||||
nu-utils = { path = "./crates/nu-utils", version = "0.88.1" }
|
nu-utils = { path = "./crates/nu-utils", version = "0.88.2" }
|
||||||
|
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
reedline = { version = "0.27.0", features = ["bashisms", "sqlite"] }
|
reedline = { version = "0.27.0", features = ["bashisms", "sqlite"] }
|
||||||
|
|
||||||
@ -97,7 +104,7 @@ nix = { version = "0.27", default-features = false, features = [
|
|||||||
] }
|
] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-test-support = { path = "./crates/nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "./crates/nu-test-support", version = "0.88.2" }
|
||||||
assert_cmd = "2.0"
|
assert_cmd = "2.0"
|
||||||
criterion = "0.5"
|
criterion = "0.5"
|
||||||
pretty_assertions = "1.4"
|
pretty_assertions = "1.4"
|
||||||
@ -166,7 +173,7 @@ bench = false
|
|||||||
# To use a development version of a dependency please use a global override here
|
# To use a development version of a dependency please use a global override here
|
||||||
# changing versions in each sub-crate of the workspace is tedious
|
# changing versions in each sub-crate of the workspace is tedious
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# reedline = { git = "https://github.com/nushell/reedline.git", branch = "main" }
|
reedline = { git = "https://github.com/nushell/reedline.git", branch = "main" }
|
||||||
# nu-ansi-term = {git = "https://github.com/nushell/nu-ansi-term.git", branch = "main"}
|
# nu-ansi-term = {git = "https://github.com/nushell/nu-ansi-term.git", branch = "main"}
|
||||||
# uu_cp = { git = "https://github.com/uutils/coreutils.git", branch = "main" }
|
# uu_cp = { git = "https://github.com/uutils/coreutils.git", branch = "main" }
|
||||||
|
|
||||||
|
@ -24,13 +24,9 @@ fn canonicalize_path(engine_state: &EngineState, path: &Path) -> PathBuf {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_home_path(engine_state: &EngineState) -> PathBuf {
|
fn get_home_path(engine_state: &EngineState) -> PathBuf {
|
||||||
let home_path = if let Some(path) = nu_path::home_dir() {
|
nu_path::home_dir()
|
||||||
let canon_home_path = canonicalize_path(engine_state, &path);
|
.map(|path| canonicalize_path(engine_state, &path))
|
||||||
canon_home_path
|
.unwrap_or_default()
|
||||||
} else {
|
|
||||||
std::path::PathBuf::new()
|
|
||||||
};
|
|
||||||
home_path
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: All benchmarks live in this 1 file to speed up build times when benchmarking.
|
// FIXME: All benchmarks live in this 1 file to speed up build times when benchmarking.
|
||||||
|
@ -5,31 +5,31 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cli"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-cli"
|
name = "nu-cli"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.1" }
|
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.2" }
|
||||||
nu-command = { path = "../nu-command", version = "0.88.1" }
|
nu-command = { path = "../nu-command", version = "0.88.2" }
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
rstest = { version = "0.18.1", default-features = false }
|
rstest = { version = "0.18.1", default-features = false }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.1" }
|
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.2" }
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-path = { path = "../nu-path", version = "0.88.1" }
|
nu-path = { path = "../nu-path", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
nu-color-config = { path = "../nu-color-config", version = "0.88.1" }
|
nu-color-config = { path = "../nu-color-config", version = "0.88.2" }
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
reedline = { version = "0.27.0", features = ["bashisms", "sqlite"] }
|
reedline = { version = "0.27.0", features = ["bashisms", "sqlite"] }
|
||||||
|
|
||||||
chrono = { default-features = false, features = ["std"], version = "0.4" }
|
chrono = { default-features = false, features = ["std"], version = "0.4" }
|
||||||
crossterm = "0.27"
|
crossterm = "0.27"
|
||||||
fancy-regex = "0.11"
|
fancy-regex = "0.12"
|
||||||
fuzzy-matcher = "0.3"
|
fuzzy-matcher = "0.3"
|
||||||
is_executable = "1.0"
|
is_executable = "1.0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
@ -34,7 +34,7 @@ impl Command for History {
|
|||||||
"Show long listing of entries for sqlite history",
|
"Show long listing of entries for sqlite history",
|
||||||
Some('l'),
|
Some('l'),
|
||||||
)
|
)
|
||||||
.category(Category::Misc)
|
.category(Category::History)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(
|
fn run(
|
@ -18,7 +18,7 @@ impl Command for HistorySession {
|
|||||||
|
|
||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("history session")
|
Signature::build("history session")
|
||||||
.category(Category::Misc)
|
.category(Category::History)
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Int)])
|
.input_output_types(vec![(Type::Nothing, Type::Int)])
|
||||||
}
|
}
|
||||||
|
|
5
crates/nu-cli/src/commands/history/mod.rs
Normal file
5
crates/nu-cli/src/commands/history/mod.rs
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
mod history_;
|
||||||
|
mod history_session;
|
||||||
|
|
||||||
|
pub use history_::History;
|
||||||
|
pub use history_session::HistorySession;
|
@ -1,15 +1,13 @@
|
|||||||
mod commandline;
|
mod commandline;
|
||||||
mod default_context;
|
mod default_context;
|
||||||
mod history;
|
mod history;
|
||||||
mod history_session;
|
|
||||||
mod keybindings;
|
mod keybindings;
|
||||||
mod keybindings_default;
|
mod keybindings_default;
|
||||||
mod keybindings_list;
|
mod keybindings_list;
|
||||||
mod keybindings_listen;
|
mod keybindings_listen;
|
||||||
|
|
||||||
pub use commandline::Commandline;
|
pub use commandline::Commandline;
|
||||||
pub use history::History;
|
pub use history::{History, HistorySession};
|
||||||
pub use history_session::HistorySession;
|
|
||||||
pub use keybindings::Keybindings;
|
pub use keybindings::Keybindings;
|
||||||
pub use keybindings_default::KeybindingsDefault;
|
pub use keybindings_default::KeybindingsDefault;
|
||||||
pub use keybindings_list::KeybindingsList;
|
pub use keybindings_list::KeybindingsList;
|
||||||
|
@ -250,7 +250,9 @@ impl NuCompleter {
|
|||||||
working_set.get_span_contents(previous_expr.0).to_vec();
|
working_set.get_span_contents(previous_expr.0).to_vec();
|
||||||
|
|
||||||
// Completion for .nu files
|
// Completion for .nu files
|
||||||
if prev_expr_str == b"use" || prev_expr_str == b"source-env"
|
if prev_expr_str == b"use"
|
||||||
|
|| prev_expr_str == b"overlay use"
|
||||||
|
|| prev_expr_str == b"source-env"
|
||||||
{
|
{
|
||||||
let mut completer =
|
let mut completer =
|
||||||
DotNuCompletion::new(self.engine_state.clone());
|
DotNuCompletion::new(self.engine_state.clone());
|
||||||
|
@ -22,7 +22,10 @@ fn complete_rec(
|
|||||||
Some(base) if matches(base, &entry_name, options) => {
|
Some(base) if matches(base, &entry_name, options) => {
|
||||||
let partial = &partial[1..];
|
let partial = &partial[1..];
|
||||||
if !partial.is_empty() || isdir {
|
if !partial.is_empty() || isdir {
|
||||||
completions.extend(complete_rec(partial, &path, options, dir, isdir))
|
completions.extend(complete_rec(partial, &path, options, dir, isdir));
|
||||||
|
if entry_name.eq(base) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
completions.push(path)
|
completions.push(path)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ use nu_protocol::{
|
|||||||
};
|
};
|
||||||
use reedline::Suggestion;
|
use reedline::Suggestion;
|
||||||
use std::{
|
use std::{
|
||||||
path::{is_separator, MAIN_SEPARATOR as SEP, MAIN_SEPARATOR_STR},
|
path::{is_separator, Path, MAIN_SEPARATOR as SEP, MAIN_SEPARATOR_STR},
|
||||||
sync::Arc,
|
sync::Arc,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -91,16 +91,21 @@ impl Completer for DotNuCompletion {
|
|||||||
// and transform them into suggestions
|
// and transform them into suggestions
|
||||||
let output: Vec<Suggestion> = search_dirs
|
let output: Vec<Suggestion> = search_dirs
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.flat_map(|it| {
|
.flat_map(|search_dir| {
|
||||||
file_path_completion(span, &partial, &it, options)
|
let completions = file_path_completion(span, &partial, &search_dir, options);
|
||||||
|
completions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|it| {
|
.filter(move |it| {
|
||||||
// Different base dir, so we list the .nu files or folders
|
// Different base dir, so we list the .nu files or folders
|
||||||
if !is_current_folder {
|
if !is_current_folder {
|
||||||
it.1.ends_with(".nu") || it.1.ends_with(SEP)
|
it.1.ends_with(".nu") || it.1.ends_with(SEP)
|
||||||
} else {
|
} else {
|
||||||
// Lib dirs, so we filter only the .nu files
|
// Lib dirs, so we filter only the .nu files or directory modules
|
||||||
it.1.ends_with(".nu")
|
if it.1.ends_with(SEP) {
|
||||||
|
Path::new(&search_dir).join(&it.1).join("mod.nu").exists()
|
||||||
|
} else {
|
||||||
|
it.1.ends_with(".nu")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.map(move |x| Suggestion {
|
.map(move |x| Suggestion {
|
||||||
|
@ -35,6 +35,10 @@ pub fn evaluate_commands(
|
|||||||
let mut working_set = StateWorkingSet::new(engine_state);
|
let mut working_set = StateWorkingSet::new(engine_state);
|
||||||
|
|
||||||
let output = parse(&mut working_set, None, commands.item.as_bytes(), false);
|
let output = parse(&mut working_set, None, commands.item.as_bytes(), false);
|
||||||
|
if let Some(warning) = working_set.parse_warnings.first() {
|
||||||
|
report_error(&working_set, warning);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(err) = working_set.parse_errors.first() {
|
if let Some(err) = working_set.parse_errors.first() {
|
||||||
report_error(&working_set, err);
|
report_error(&working_set, err);
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
use crate::prompt_update::{POST_PROMPT_MARKER, PRE_PROMPT_MARKER};
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use nu_utils::enable_vt_processing;
|
use nu_utils::enable_vt_processing;
|
||||||
use reedline::DefaultPrompt;
|
use reedline::DefaultPrompt;
|
||||||
@ -11,6 +12,7 @@ use {
|
|||||||
/// Nushell prompt definition
|
/// Nushell prompt definition
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct NushellPrompt {
|
pub struct NushellPrompt {
|
||||||
|
shell_integration: bool,
|
||||||
left_prompt_string: Option<String>,
|
left_prompt_string: Option<String>,
|
||||||
right_prompt_string: Option<String>,
|
right_prompt_string: Option<String>,
|
||||||
default_prompt_indicator: Option<String>,
|
default_prompt_indicator: Option<String>,
|
||||||
@ -20,15 +22,10 @@ pub struct NushellPrompt {
|
|||||||
render_right_prompt_on_last_line: bool,
|
render_right_prompt_on_last_line: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for NushellPrompt {
|
|
||||||
fn default() -> Self {
|
|
||||||
NushellPrompt::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl NushellPrompt {
|
impl NushellPrompt {
|
||||||
pub fn new() -> NushellPrompt {
|
pub fn new(shell_integration: bool) -> NushellPrompt {
|
||||||
NushellPrompt {
|
NushellPrompt {
|
||||||
|
shell_integration,
|
||||||
left_prompt_string: None,
|
left_prompt_string: None,
|
||||||
right_prompt_string: None,
|
right_prompt_string: None,
|
||||||
default_prompt_indicator: None,
|
default_prompt_indicator: None,
|
||||||
@ -111,7 +108,11 @@ impl Prompt for NushellPrompt {
|
|||||||
.to_string()
|
.to_string()
|
||||||
.replace('\n', "\r\n");
|
.replace('\n', "\r\n");
|
||||||
|
|
||||||
prompt.into()
|
if self.shell_integration {
|
||||||
|
format!("{PRE_PROMPT_MARKER}{prompt}{POST_PROMPT_MARKER}").into()
|
||||||
|
} else {
|
||||||
|
prompt.into()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,8 +7,6 @@ use nu_protocol::{
|
|||||||
Config, PipelineData, Value,
|
Config, PipelineData, Value,
|
||||||
};
|
};
|
||||||
use reedline::Prompt;
|
use reedline::Prompt;
|
||||||
use std::borrow::Cow;
|
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
// Name of environment variable where the prompt could be stored
|
// Name of environment variable where the prompt could be stored
|
||||||
pub(crate) const PROMPT_COMMAND: &str = "PROMPT_COMMAND";
|
pub(crate) const PROMPT_COMMAND: &str = "PROMPT_COMMAND";
|
||||||
@ -28,8 +26,8 @@ pub(crate) const TRANSIENT_PROMPT_MULTILINE_INDICATOR: &str =
|
|||||||
"TRANSIENT_PROMPT_MULTILINE_INDICATOR";
|
"TRANSIENT_PROMPT_MULTILINE_INDICATOR";
|
||||||
// According to Daniel Imms @Tyriar, we need to do these this way:
|
// According to Daniel Imms @Tyriar, we need to do these this way:
|
||||||
// <133 A><prompt><133 B><command><133 C><command output>
|
// <133 A><prompt><133 B><command><133 C><command output>
|
||||||
const PRE_PROMPT_MARKER: &str = "\x1b]133;A\x1b\\";
|
pub(crate) const PRE_PROMPT_MARKER: &str = "\x1b]133;A\x1b\\";
|
||||||
const POST_PROMPT_MARKER: &str = "\x1b]133;B\x1b\\";
|
pub(crate) const POST_PROMPT_MARKER: &str = "\x1b]133;B\x1b\\";
|
||||||
|
|
||||||
fn get_prompt_string(
|
fn get_prompt_string(
|
||||||
prompt: &str,
|
prompt: &str,
|
||||||
@ -98,12 +96,12 @@ fn get_prompt_string(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn update_prompt<'prompt>(
|
pub(crate) fn update_prompt(
|
||||||
config: &Config,
|
config: &Config,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
stack: &Stack,
|
stack: &Stack,
|
||||||
nu_prompt: &'prompt mut NushellPrompt,
|
nu_prompt: &mut NushellPrompt,
|
||||||
) -> &'prompt dyn Prompt {
|
) {
|
||||||
let mut stack = stack.clone();
|
let mut stack = stack.clone();
|
||||||
|
|
||||||
let left_prompt_string = get_prompt_string(PROMPT_COMMAND, config, engine_state, &mut stack);
|
let left_prompt_string = get_prompt_string(PROMPT_COMMAND, config, engine_state, &mut stack);
|
||||||
@ -146,125 +144,55 @@ pub(crate) fn update_prompt<'prompt>(
|
|||||||
(prompt_vi_insert_string, prompt_vi_normal_string),
|
(prompt_vi_insert_string, prompt_vi_normal_string),
|
||||||
config.render_right_prompt_on_last_line,
|
config.render_right_prompt_on_last_line,
|
||||||
);
|
);
|
||||||
|
|
||||||
let ret_val = nu_prompt as &dyn Prompt;
|
|
||||||
trace!("update_prompt {}:{}:{}", file!(), line!(), column!());
|
trace!("update_prompt {}:{}:{}", file!(), line!(), column!());
|
||||||
|
|
||||||
ret_val
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct TransientPrompt {
|
/// Construct the transient prompt based on the normal nu_prompt
|
||||||
engine_state: Arc<EngineState>,
|
pub(crate) fn make_transient_prompt(
|
||||||
stack: Stack,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Try getting `$env.TRANSIENT_PROMPT_<X>`, and get `$env.PROMPT_<X>` if that fails
|
|
||||||
fn get_transient_prompt_string(
|
|
||||||
transient_prompt: &str,
|
|
||||||
prompt: &str,
|
|
||||||
config: &Config,
|
config: &Config,
|
||||||
engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
stack: &mut Stack,
|
stack: &mut Stack,
|
||||||
) -> Option<String> {
|
nu_prompt: &NushellPrompt,
|
||||||
get_prompt_string(transient_prompt, config, engine_state, stack)
|
) -> Box<dyn Prompt> {
|
||||||
.or_else(|| get_prompt_string(prompt, config, engine_state, stack))
|
let mut nu_prompt = nu_prompt.clone();
|
||||||
}
|
|
||||||
|
|
||||||
impl Prompt for TransientPrompt {
|
if let Some(s) = get_prompt_string(TRANSIENT_PROMPT_COMMAND, config, engine_state, stack) {
|
||||||
fn render_prompt_left(&self) -> Cow<str> {
|
nu_prompt.update_prompt_left(Some(s))
|
||||||
let mut nu_prompt = NushellPrompt::new();
|
|
||||||
let config = &self.engine_state.get_config().clone();
|
|
||||||
let mut stack = self.stack.clone();
|
|
||||||
nu_prompt.update_prompt_left(get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_COMMAND,
|
|
||||||
PROMPT_COMMAND,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
));
|
|
||||||
nu_prompt.render_prompt_left().to_string().into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_prompt_right(&self) -> Cow<str> {
|
if let Some(s) = get_prompt_string(TRANSIENT_PROMPT_COMMAND_RIGHT, config, engine_state, stack)
|
||||||
let mut nu_prompt = NushellPrompt::new();
|
{
|
||||||
let config = &self.engine_state.get_config().clone();
|
nu_prompt.update_prompt_right(Some(s), config.render_right_prompt_on_last_line)
|
||||||
let mut stack = self.stack.clone();
|
|
||||||
nu_prompt.update_prompt_right(
|
|
||||||
get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_COMMAND_RIGHT,
|
|
||||||
PROMPT_COMMAND_RIGHT,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
),
|
|
||||||
config.render_right_prompt_on_last_line,
|
|
||||||
);
|
|
||||||
nu_prompt.render_prompt_right().to_string().into()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_prompt_indicator(&self, prompt_mode: reedline::PromptEditMode) -> Cow<str> {
|
if let Some(s) = get_prompt_string(TRANSIENT_PROMPT_INDICATOR, config, engine_state, stack) {
|
||||||
let mut nu_prompt = NushellPrompt::new();
|
nu_prompt.update_prompt_indicator(Some(s))
|
||||||
let config = &self.engine_state.get_config().clone();
|
|
||||||
let mut stack = self.stack.clone();
|
|
||||||
nu_prompt.update_prompt_indicator(get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_INDICATOR,
|
|
||||||
PROMPT_INDICATOR,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
));
|
|
||||||
nu_prompt.update_prompt_vi_insert(get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_INDICATOR_VI_INSERT,
|
|
||||||
PROMPT_INDICATOR_VI_INSERT,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
));
|
|
||||||
nu_prompt.update_prompt_vi_normal(get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_INDICATOR_VI_NORMAL,
|
|
||||||
PROMPT_INDICATOR_VI_NORMAL,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
));
|
|
||||||
nu_prompt
|
|
||||||
.render_prompt_indicator(prompt_mode)
|
|
||||||
.to_string()
|
|
||||||
.into()
|
|
||||||
}
|
}
|
||||||
|
if let Some(s) = get_prompt_string(
|
||||||
fn render_prompt_multiline_indicator(&self) -> Cow<str> {
|
TRANSIENT_PROMPT_INDICATOR_VI_INSERT,
|
||||||
let mut nu_prompt = NushellPrompt::new();
|
config,
|
||||||
let config = &self.engine_state.get_config().clone();
|
|
||||||
let mut stack = self.stack.clone();
|
|
||||||
nu_prompt.update_prompt_multiline(get_transient_prompt_string(
|
|
||||||
TRANSIENT_PROMPT_MULTILINE_INDICATOR,
|
|
||||||
PROMPT_MULTILINE_INDICATOR,
|
|
||||||
config,
|
|
||||||
&self.engine_state,
|
|
||||||
&mut stack,
|
|
||||||
));
|
|
||||||
nu_prompt
|
|
||||||
.render_prompt_multiline_indicator()
|
|
||||||
.to_string()
|
|
||||||
.into()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn render_prompt_history_search_indicator(
|
|
||||||
&self,
|
|
||||||
history_search: reedline::PromptHistorySearch,
|
|
||||||
) -> Cow<str> {
|
|
||||||
NushellPrompt::new()
|
|
||||||
.render_prompt_history_search_indicator(history_search)
|
|
||||||
.to_string()
|
|
||||||
.into()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Construct the transient prompt
|
|
||||||
pub(crate) fn transient_prompt(engine_state: Arc<EngineState>, stack: &Stack) -> Box<dyn Prompt> {
|
|
||||||
Box::new(TransientPrompt {
|
|
||||||
engine_state,
|
engine_state,
|
||||||
stack: stack.clone(),
|
stack,
|
||||||
})
|
) {
|
||||||
|
nu_prompt.update_prompt_vi_insert(Some(s))
|
||||||
|
}
|
||||||
|
if let Some(s) = get_prompt_string(
|
||||||
|
TRANSIENT_PROMPT_INDICATOR_VI_NORMAL,
|
||||||
|
config,
|
||||||
|
engine_state,
|
||||||
|
stack,
|
||||||
|
) {
|
||||||
|
nu_prompt.update_prompt_vi_normal(Some(s))
|
||||||
|
}
|
||||||
|
|
||||||
|
if let Some(s) = get_prompt_string(
|
||||||
|
TRANSIENT_PROMPT_MULTILINE_INDICATOR,
|
||||||
|
config,
|
||||||
|
engine_state,
|
||||||
|
stack,
|
||||||
|
) {
|
||||||
|
nu_prompt.update_prompt_multiline(Some(s))
|
||||||
|
}
|
||||||
|
|
||||||
|
Box::new(nu_prompt)
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,8 @@ pub fn evaluate_repl(
|
|||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
use nu_cmd_base::hook;
|
use nu_cmd_base::hook;
|
||||||
use reedline::Signal;
|
use reedline::Signal;
|
||||||
let use_color = engine_state.get_config().use_ansi_coloring;
|
let config = engine_state.get_config();
|
||||||
|
let use_color = config.use_ansi_coloring;
|
||||||
|
|
||||||
// Guard against invocation without a connected terminal.
|
// Guard against invocation without a connected terminal.
|
||||||
// reedline / crossterm event polling will fail without a connected tty
|
// reedline / crossterm event polling will fail without a connected tty
|
||||||
@ -68,7 +69,7 @@ pub fn evaluate_repl(
|
|||||||
|
|
||||||
let mut entry_num = 0;
|
let mut entry_num = 0;
|
||||||
|
|
||||||
let mut nu_prompt = NushellPrompt::new();
|
let mut nu_prompt = NushellPrompt::new(config.shell_integration);
|
||||||
|
|
||||||
let start_time = std::time::Instant::now();
|
let start_time = std::time::Instant::now();
|
||||||
// Translate environment variables from Strings to Values
|
// Translate environment variables from Strings to Values
|
||||||
@ -212,20 +213,6 @@ pub fn evaluate_repl(
|
|||||||
use_color,
|
use_color,
|
||||||
);
|
);
|
||||||
|
|
||||||
start_time = std::time::Instant::now();
|
|
||||||
// Reset the SIGQUIT handler
|
|
||||||
if let Some(sig_quit) = engine_state.get_sig_quit() {
|
|
||||||
sig_quit.store(false, Ordering::SeqCst);
|
|
||||||
}
|
|
||||||
perf(
|
|
||||||
"reset sig_quit",
|
|
||||||
start_time,
|
|
||||||
file!(),
|
|
||||||
line!(),
|
|
||||||
column!(),
|
|
||||||
use_color,
|
|
||||||
);
|
|
||||||
|
|
||||||
start_time = std::time::Instant::now();
|
start_time = std::time::Instant::now();
|
||||||
let config = engine_state.get_config();
|
let config = engine_state.get_config();
|
||||||
|
|
||||||
@ -267,11 +254,7 @@ pub fn evaluate_repl(
|
|||||||
.with_quick_completions(config.quick_completions)
|
.with_quick_completions(config.quick_completions)
|
||||||
.with_partial_completions(config.partial_completions)
|
.with_partial_completions(config.partial_completions)
|
||||||
.with_ansi_colors(config.use_ansi_coloring)
|
.with_ansi_colors(config.use_ansi_coloring)
|
||||||
.with_cursor_config(cursor_config)
|
.with_cursor_config(cursor_config);
|
||||||
.with_transient_prompt(prompt_update::transient_prompt(
|
|
||||||
engine_reference.clone(),
|
|
||||||
stack,
|
|
||||||
));
|
|
||||||
perf(
|
perf(
|
||||||
"reedline builder",
|
"reedline builder",
|
||||||
start_time,
|
start_time,
|
||||||
@ -424,7 +407,9 @@ pub fn evaluate_repl(
|
|||||||
|
|
||||||
start_time = std::time::Instant::now();
|
start_time = std::time::Instant::now();
|
||||||
let config = &engine_state.get_config().clone();
|
let config = &engine_state.get_config().clone();
|
||||||
let prompt = prompt_update::update_prompt(config, engine_state, stack, &mut nu_prompt);
|
prompt_update::update_prompt(config, engine_state, stack, &mut nu_prompt);
|
||||||
|
let transient_prompt =
|
||||||
|
prompt_update::make_transient_prompt(config, engine_state, stack, &nu_prompt);
|
||||||
perf(
|
perf(
|
||||||
"update_prompt",
|
"update_prompt",
|
||||||
start_time,
|
start_time,
|
||||||
@ -437,7 +422,8 @@ pub fn evaluate_repl(
|
|||||||
entry_num += 1;
|
entry_num += 1;
|
||||||
|
|
||||||
start_time = std::time::Instant::now();
|
start_time = std::time::Instant::now();
|
||||||
let input = line_editor.read_line(prompt);
|
line_editor = line_editor.with_transient_prompt(transient_prompt);
|
||||||
|
let input = line_editor.read_line(&nu_prompt);
|
||||||
let shell_integration = config.shell_integration;
|
let shell_integration = config.shell_integration;
|
||||||
|
|
||||||
match input {
|
match input {
|
||||||
@ -764,7 +750,7 @@ fn map_nucursorshape_to_cursorshape(shape: NuCursorShape) -> Option<SetCursorSty
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_command_finished_marker(stack: &Stack, engine_state: &EngineState) -> String {
|
fn get_command_finished_marker(stack: &Stack, engine_state: &EngineState) -> String {
|
||||||
let exit_code = stack
|
let exit_code = stack
|
||||||
.get_env_var(engine_state, "LAST_EXIT_CODE")
|
.get_env_var(engine_state, "LAST_EXIT_CODE")
|
||||||
.and_then(|e| e.as_i64().ok());
|
.and_then(|e| e.as_i64().ok());
|
||||||
|
@ -329,7 +329,6 @@ fn find_matching_block_end_in_expr(
|
|||||||
Expr::ImportPattern(_) => None,
|
Expr::ImportPattern(_) => None,
|
||||||
Expr::Overlay(_) => None,
|
Expr::Overlay(_) => None,
|
||||||
Expr::Signature(_) => None,
|
Expr::Signature(_) => None,
|
||||||
Expr::MatchPattern(_) => None,
|
|
||||||
Expr::MatchBlock(_) => None,
|
Expr::MatchBlock(_) => None,
|
||||||
Expr::Nothing => None,
|
Expr::Nothing => None,
|
||||||
Expr::Garbage => None,
|
Expr::Garbage => None,
|
||||||
|
@ -220,6 +220,10 @@ pub fn eval_source(
|
|||||||
source,
|
source,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
|
if let Some(warning) = working_set.parse_warnings.first() {
|
||||||
|
report_error(&working_set, warning);
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(err) = working_set.parse_errors.first() {
|
if let Some(err) = working_set.parse_errors.first() {
|
||||||
set_last_exit_code(stack, 1);
|
set_last_exit_code(stack, 1);
|
||||||
report_error(&working_set, err);
|
report_error(&working_set, err);
|
||||||
|
@ -91,7 +91,7 @@ fn variables_dollar_sign_with_varialblecompletion() {
|
|||||||
let target_dir = "$ ";
|
let target_dir = "$ ";
|
||||||
let suggestions = completer.complete(target_dir, target_dir.len());
|
let suggestions = completer.complete(target_dir, target_dir.len());
|
||||||
|
|
||||||
assert_eq!(7, suggestions.len());
|
assert_eq!(8, suggestions.len());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[rstest]
|
#[rstest]
|
||||||
@ -144,15 +144,34 @@ fn dotnu_completions() {
|
|||||||
let completion_str = "source-env ".to_string();
|
let completion_str = "source-env ".to_string();
|
||||||
let suggestions = completer.complete(&completion_str, completion_str.len());
|
let suggestions = completer.complete(&completion_str, completion_str.len());
|
||||||
|
|
||||||
assert_eq!(1, suggestions.len());
|
assert_eq!(2, suggestions.len());
|
||||||
assert_eq!("custom_completion.nu", suggestions.first().unwrap().value);
|
assert_eq!("custom_completion.nu", suggestions.first().unwrap().value);
|
||||||
|
#[cfg(windows)]
|
||||||
|
assert_eq!("directory_completion\\", suggestions.get(1).unwrap().value);
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
assert_eq!("directory_completion/", suggestions.get(1).unwrap().value);
|
||||||
|
|
||||||
// Test use completion
|
// Test use completion
|
||||||
let completion_str = "use ".to_string();
|
let completion_str = "use ".to_string();
|
||||||
let suggestions = completer.complete(&completion_str, completion_str.len());
|
let suggestions = completer.complete(&completion_str, completion_str.len());
|
||||||
|
|
||||||
assert_eq!(1, suggestions.len());
|
assert_eq!(2, suggestions.len());
|
||||||
assert_eq!("custom_completion.nu", suggestions.first().unwrap().value);
|
assert_eq!("custom_completion.nu", suggestions.first().unwrap().value);
|
||||||
|
#[cfg(windows)]
|
||||||
|
assert_eq!("directory_completion\\", suggestions.get(1).unwrap().value);
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
assert_eq!("directory_completion/", suggestions.get(1).unwrap().value);
|
||||||
|
|
||||||
|
// Test overlay use completion
|
||||||
|
let completion_str = "overlay use ".to_string();
|
||||||
|
let suggestions = completer.complete(&completion_str, completion_str.len());
|
||||||
|
|
||||||
|
assert_eq!(2, suggestions.len());
|
||||||
|
assert_eq!("custom_completion.nu", suggestions.first().unwrap().value);
|
||||||
|
#[cfg(windows)]
|
||||||
|
assert_eq!("directory_completion\\", suggestions.get(1).unwrap().value);
|
||||||
|
#[cfg(not(windows))]
|
||||||
|
assert_eq!("directory_completion/", suggestions.get(1).unwrap().value);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -208,6 +227,7 @@ fn file_completions() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
folder(dir.join("another")),
|
folder(dir.join("another")),
|
||||||
file(dir.join("custom_completion.nu")),
|
file(dir.join("custom_completion.nu")),
|
||||||
|
folder(dir.join("directory_completion")),
|
||||||
file(dir.join("nushell")),
|
file(dir.join("nushell")),
|
||||||
folder(dir.join("test_a")),
|
folder(dir.join("test_a")),
|
||||||
folder(dir.join("test_b")),
|
folder(dir.join("test_b")),
|
||||||
@ -323,6 +343,7 @@ fn command_ls_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -333,6 +354,7 @@ fn command_ls_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -355,6 +377,7 @@ fn command_open_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -365,6 +388,7 @@ fn command_open_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -388,6 +412,7 @@ fn command_rm_with_globcompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -398,6 +423,7 @@ fn command_rm_with_globcompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -421,6 +447,7 @@ fn command_cp_with_globcompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -431,6 +458,7 @@ fn command_cp_with_globcompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -454,6 +482,7 @@ fn command_save_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -464,6 +493,7 @@ fn command_save_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -487,6 +517,7 @@ fn command_touch_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -497,6 +528,7 @@ fn command_touch_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -520,6 +552,7 @@ fn command_watch_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -530,6 +563,7 @@ fn command_watch_with_filecompletion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -625,6 +659,7 @@ fn folder_with_directorycompletions() {
|
|||||||
// Create the expected values
|
// Create the expected values
|
||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
folder(dir.join("another")),
|
folder(dir.join("another")),
|
||||||
|
folder(dir.join("directory_completion")),
|
||||||
folder(dir.join("test_a")),
|
folder(dir.join("test_a")),
|
||||||
folder(dir.join("test_b")),
|
folder(dir.join("test_b")),
|
||||||
folder(dir.join(".hidden_folder")),
|
folder(dir.join(".hidden_folder")),
|
||||||
@ -839,6 +874,7 @@ fn unknown_command_completion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -849,6 +885,7 @@ fn unknown_command_completion() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
@ -899,6 +936,7 @@ fn filecompletions_triggers_after_cursor() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another\\".to_string(),
|
"another\\".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion\\".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a\\".to_string(),
|
"test_a\\".to_string(),
|
||||||
"test_b\\".to_string(),
|
"test_b\\".to_string(),
|
||||||
@ -909,6 +947,7 @@ fn filecompletions_triggers_after_cursor() {
|
|||||||
let expected_paths: Vec<String> = vec![
|
let expected_paths: Vec<String> = vec![
|
||||||
"another/".to_string(),
|
"another/".to_string(),
|
||||||
"custom_completion.nu".to_string(),
|
"custom_completion.nu".to_string(),
|
||||||
|
"directory_completion/".to_string(),
|
||||||
"nushell".to_string(),
|
"nushell".to_string(),
|
||||||
"test_a/".to_string(),
|
"test_a/".to_string(),
|
||||||
"test_b/".to_string(),
|
"test_b/".to_string(),
|
||||||
|
@ -5,21 +5,21 @@ edition = "2021"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-cmd-base"
|
name = "nu-cmd-base"
|
||||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-base"
|
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-base"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-glob = { path = "../nu-glob", version = "0.88.1" }
|
nu-glob = { path = "../nu-glob", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-path = { path = "../nu-path", version = "0.88.1" }
|
nu-path = { path = "../nu-path", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
|
|
||||||
indexmap = "2.1"
|
indexmap = "2.1"
|
||||||
miette = "5.10.0"
|
miette = "5.10.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
rstest = "0.18.2"
|
rstest = "0.18.2"
|
||||||
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-cmd-dataframe"
|
name = "nu-cmd-dataframe"
|
||||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-dataframe"
|
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-dataframe"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@ -13,9 +13,9 @@ version = "0.88.1"
|
|||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
|
|
||||||
# Potential dependencies for extras
|
# Potential dependencies for extras
|
||||||
chrono = { version = "0.4", features = ["std", "unstable-locales"], default-features = false }
|
chrono = { version = "0.4", features = ["std", "unstable-locales"], default-features = false }
|
||||||
@ -24,11 +24,11 @@ fancy-regex = "0.12"
|
|||||||
indexmap = { version = "2.1" }
|
indexmap = { version = "2.1" }
|
||||||
num = { version = "0.4", optional = true }
|
num = { version = "0.4", optional = true }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
sqlparser = { version = "0.39", optional = true }
|
sqlparser = { version = "0.41", optional = true }
|
||||||
polars-io = { version = "0.35", features = ["avro"], optional = true }
|
polars-io = { version = "0.35", features = ["avro"], optional = true }
|
||||||
polars-arrow = "0.35"
|
polars-arrow = { version = "0.35", optional = true }
|
||||||
polars-ops = "0.35"
|
polars-ops = { version = "0.35", optional = true }
|
||||||
polars-plan = "0.35"
|
polars-plan = { version = "0.35", optional = true }
|
||||||
|
|
||||||
[dependencies.polars]
|
[dependencies.polars]
|
||||||
features = [
|
features = [
|
||||||
@ -65,9 +65,9 @@ optional = true
|
|||||||
version = "0.35"
|
version = "0.35"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
dataframe = ["num", "polars", "polars-io", "sqlparser"]
|
dataframe = ["num", "polars", "polars-io", "polars-arrow", "polars-ops", "polars-plan", "sqlparser"]
|
||||||
default = []
|
default = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.1" }
|
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.2" }
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
use super::{DataFrameValue, NuDataFrame};
|
use std::ops::{Deref, DerefMut};
|
||||||
|
|
||||||
use chrono::{DateTime, FixedOffset, NaiveDateTime};
|
use chrono::{DateTime, Duration, FixedOffset, NaiveTime, TimeZone, Utc};
|
||||||
|
use chrono_tz::Tz;
|
||||||
use indexmap::map::{Entry, IndexMap};
|
use indexmap::map::{Entry, IndexMap};
|
||||||
use nu_protocol::{Record, ShellError, Span, Value};
|
|
||||||
use polars::chunked_array::builder::AnonymousOwnedListBuilder;
|
use polars::chunked_array::builder::AnonymousOwnedListBuilder;
|
||||||
use polars::chunked_array::object::builder::ObjectChunkedBuilder;
|
use polars::chunked_array::object::builder::ObjectChunkedBuilder;
|
||||||
use polars::chunked_array::ChunkedArray;
|
use polars::chunked_array::ChunkedArray;
|
||||||
|
use polars::datatypes::AnyValue;
|
||||||
use polars::export::arrow::Either;
|
use polars::export::arrow::Either;
|
||||||
use polars::prelude::{
|
use polars::prelude::{
|
||||||
DataFrame, DataType, DatetimeChunked, Float64Type, Int64Type, IntoSeries,
|
DataFrame, DataType, DatetimeChunked, Float64Type, Int64Type, IntoSeries,
|
||||||
@ -13,11 +14,14 @@ use polars::prelude::{
|
|||||||
ListUtf8ChunkedBuilder, NamedFrom, NewChunkedArray, ObjectType, Series, TemporalMethods,
|
ListUtf8ChunkedBuilder, NamedFrom, NewChunkedArray, ObjectType, Series, TemporalMethods,
|
||||||
TimeUnit,
|
TimeUnit,
|
||||||
};
|
};
|
||||||
use std::ops::{Deref, DerefMut};
|
|
||||||
|
|
||||||
const SECS_PER_DAY: i64 = 86_400;
|
use nu_protocol::{Record, ShellError, Span, Value};
|
||||||
|
|
||||||
// The values capacity is for the size of an internal vec.
|
use super::{DataFrameValue, NuDataFrame};
|
||||||
|
|
||||||
|
const NANOS_PER_DAY: i64 = 86_400_000_000_000;
|
||||||
|
|
||||||
|
// The values capacity is for the size of an vec.
|
||||||
// Since this is impossible to determine without traversing every value
|
// Since this is impossible to determine without traversing every value
|
||||||
// I just picked one. Since this is for converting back and forth
|
// I just picked one. Since this is for converting back and forth
|
||||||
// between nushell tables the values shouldn't be too extremely large for
|
// between nushell tables the values shouldn't be too extremely large for
|
||||||
@ -199,7 +203,7 @@ fn value_to_input_type(value: &Value) -> InputType {
|
|||||||
Value::Filesize { .. } => InputType::Filesize,
|
Value::Filesize { .. } => InputType::Filesize,
|
||||||
Value::List { vals, .. } => {
|
Value::List { vals, .. } => {
|
||||||
// We need to determined the type inside of the list.
|
// We need to determined the type inside of the list.
|
||||||
// Since Value::List does not have any kind of internal
|
// Since Value::List does not have any kind of
|
||||||
// type information, we need to look inside the list.
|
// type information, we need to look inside the list.
|
||||||
// This will cause errors if lists have inconsistent types.
|
// This will cause errors if lists have inconsistent types.
|
||||||
// Basically, if a list column needs to be converted to dataframe,
|
// Basically, if a list column needs to be converted to dataframe,
|
||||||
@ -775,28 +779,21 @@ fn series_to_values(
|
|||||||
}),
|
}),
|
||||||
Some(ca) => {
|
Some(ca) => {
|
||||||
let it = ca.into_iter();
|
let it = ca.into_iter();
|
||||||
let values: Vec<Value> =
|
if let (Some(size), Some(from_row)) = (maybe_size, maybe_from_row) {
|
||||||
if let (Some(size), Some(from_row)) = (maybe_size, maybe_from_row) {
|
Either::Left(it.skip(from_row).take(size))
|
||||||
Either::Left(it.skip(from_row).take(size))
|
} else {
|
||||||
|
Either::Right(it)
|
||||||
|
}
|
||||||
|
.map(|ca| {
|
||||||
|
let sublist: Vec<Value> = if let Some(ref s) = ca {
|
||||||
|
series_to_values(s, None, None, Span::unknown())?
|
||||||
} else {
|
} else {
|
||||||
Either::Right(it)
|
// empty item
|
||||||
}
|
vec![]
|
||||||
.map(|ca| {
|
};
|
||||||
let sublist = ca
|
Ok(Value::list(sublist, span))
|
||||||
.map(|ref s| {
|
})
|
||||||
match series_to_values(s, None, None, Span::unknown()) {
|
.collect::<Result<Vec<Value>, ShellError>>()
|
||||||
Ok(v) => v,
|
|
||||||
Err(e) => {
|
|
||||||
eprintln!("Error list values: {e}");
|
|
||||||
vec![]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.unwrap_or(vec![]);
|
|
||||||
Value::list(sublist, span)
|
|
||||||
})
|
|
||||||
.collect::<Vec<Value>>();
|
|
||||||
Ok(values)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -817,51 +814,16 @@ fn series_to_values(
|
|||||||
}
|
}
|
||||||
.map(|v| match v {
|
.map(|v| match v {
|
||||||
Some(a) => {
|
Some(a) => {
|
||||||
// elapsed time in day since 1970-01-01
|
let nanos = nanos_per_day(a);
|
||||||
let seconds = a as i64 * SECS_PER_DAY;
|
let datetime = datetime_from_epoch_nanos(nanos, &None, span)?;
|
||||||
let naive_datetime = match NaiveDateTime::from_timestamp_opt(seconds, 0) {
|
Ok(Value::date(datetime, span))
|
||||||
Some(val) => val,
|
|
||||||
None => {
|
|
||||||
return Value::error(
|
|
||||||
ShellError::UnsupportedInput {
|
|
||||||
msg: "The given local datetime representation is invalid."
|
|
||||||
.to_string(),
|
|
||||||
input: format!("timestamp is {a:?}"),
|
|
||||||
msg_span: span,
|
|
||||||
input_span: Span::unknown(),
|
|
||||||
},
|
|
||||||
span,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Zero length offset
|
|
||||||
let offset = match FixedOffset::east_opt(0) {
|
|
||||||
Some(val) => val,
|
|
||||||
None => {
|
|
||||||
return Value::error(
|
|
||||||
ShellError::UnsupportedInput {
|
|
||||||
msg: "The given local datetime representation is invalid."
|
|
||||||
.to_string(),
|
|
||||||
input: format!("timestamp is {a:?}"),
|
|
||||||
msg_span: span,
|
|
||||||
input_span: Span::unknown(),
|
|
||||||
},
|
|
||||||
span,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let datetime =
|
|
||||||
DateTime::<FixedOffset>::from_naive_utc_and_offset(naive_datetime, offset);
|
|
||||||
|
|
||||||
Value::date(datetime, span)
|
|
||||||
}
|
}
|
||||||
None => Value::nothing(span),
|
None => Ok(Value::nothing(span)),
|
||||||
})
|
})
|
||||||
.collect::<Vec<Value>>();
|
.collect::<Result<Vec<Value>, ShellError>>()?;
|
||||||
|
|
||||||
Ok(values)
|
Ok(values)
|
||||||
}
|
}
|
||||||
DataType::Datetime(time_unit, _) => {
|
DataType::Datetime(time_unit, tz) => {
|
||||||
let casted = series.datetime().map_err(|e| ShellError::GenericError {
|
let casted = series.datetime().map_err(|e| ShellError::GenericError {
|
||||||
error: "Error casting column to datetime".into(),
|
error: "Error casting column to datetime".into(),
|
||||||
msg: "".into(),
|
msg: "".into(),
|
||||||
@ -878,55 +840,46 @@ fn series_to_values(
|
|||||||
}
|
}
|
||||||
.map(|v| match v {
|
.map(|v| match v {
|
||||||
Some(a) => {
|
Some(a) => {
|
||||||
let unit_divisor = match time_unit {
|
|
||||||
TimeUnit::Nanoseconds => 1_000_000_000,
|
|
||||||
TimeUnit::Microseconds => 1_000_000,
|
|
||||||
TimeUnit::Milliseconds => 1_000,
|
|
||||||
};
|
|
||||||
// elapsed time in nano/micro/milliseconds since 1970-01-01
|
// elapsed time in nano/micro/milliseconds since 1970-01-01
|
||||||
let seconds = a / unit_divisor;
|
let nanos = nanos_from_timeunit(a, *time_unit);
|
||||||
let naive_datetime = match NaiveDateTime::from_timestamp_opt(seconds, 0) {
|
let datetime = datetime_from_epoch_nanos(nanos, tz, span)?;
|
||||||
Some(val) => val,
|
Ok(Value::date(datetime, span))
|
||||||
None => {
|
|
||||||
return Value::error(
|
|
||||||
ShellError::UnsupportedInput {
|
|
||||||
msg: "The given local datetime representation is invalid."
|
|
||||||
.to_string(),
|
|
||||||
input: format!("timestamp is {a:?}"),
|
|
||||||
msg_span: span,
|
|
||||||
input_span: Span::unknown(),
|
|
||||||
},
|
|
||||||
span,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Zero length offset
|
|
||||||
let offset = match FixedOffset::east_opt(0) {
|
|
||||||
Some(val) => val,
|
|
||||||
None => {
|
|
||||||
return Value::error(
|
|
||||||
ShellError::UnsupportedInput {
|
|
||||||
msg: "The given local datetime representation is invalid."
|
|
||||||
.to_string(),
|
|
||||||
input: format!("timestamp is {a:?}"),
|
|
||||||
msg_span: span,
|
|
||||||
input_span: Span::unknown(),
|
|
||||||
},
|
|
||||||
span,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let datetime =
|
|
||||||
DateTime::<FixedOffset>::from_naive_utc_and_offset(naive_datetime, offset);
|
|
||||||
|
|
||||||
Value::date(datetime, span)
|
|
||||||
}
|
}
|
||||||
None => Value::nothing(span),
|
None => Ok(Value::nothing(span)),
|
||||||
})
|
})
|
||||||
.collect::<Vec<Value>>();
|
.collect::<Result<Vec<Value>, ShellError>>()?;
|
||||||
|
|
||||||
Ok(values)
|
Ok(values)
|
||||||
}
|
}
|
||||||
|
DataType::Struct(polar_fields) => {
|
||||||
|
let casted = series.struct_().map_err(|e| ShellError::GenericError {
|
||||||
|
error: "Error casting column to struct".into(),
|
||||||
|
msg: "".to_string(),
|
||||||
|
span: None,
|
||||||
|
help: Some(e.to_string()),
|
||||||
|
inner: Vec::new(),
|
||||||
|
})?;
|
||||||
|
let it = casted.into_iter();
|
||||||
|
let values: Result<Vec<Value>, ShellError> =
|
||||||
|
if let (Some(size), Some(from_row)) = (maybe_size, maybe_from_row) {
|
||||||
|
Either::Left(it.skip(from_row).take(size))
|
||||||
|
} else {
|
||||||
|
Either::Right(it)
|
||||||
|
}
|
||||||
|
.map(|any_values| {
|
||||||
|
let vals: Result<Vec<Value>, ShellError> = any_values
|
||||||
|
.iter()
|
||||||
|
.map(|v| any_value_to_value(v, span))
|
||||||
|
.collect();
|
||||||
|
let cols: Vec<String> = polar_fields
|
||||||
|
.iter()
|
||||||
|
.map(|field| field.name.to_string())
|
||||||
|
.collect();
|
||||||
|
let record = Record::from_raw_cols_vals(cols, vals?);
|
||||||
|
Ok(Value::record(record, span))
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
values
|
||||||
|
}
|
||||||
DataType::Time => {
|
DataType::Time => {
|
||||||
let casted =
|
let casted =
|
||||||
series
|
series
|
||||||
@ -963,10 +916,152 @@ fn series_to_values(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn any_value_to_value(any_value: &AnyValue, span: Span) -> Result<Value, ShellError> {
|
||||||
|
match any_value {
|
||||||
|
AnyValue::Null => Ok(Value::nothing(span)),
|
||||||
|
AnyValue::Boolean(b) => Ok(Value::bool(*b, span)),
|
||||||
|
AnyValue::Utf8(s) => Ok(Value::string(s.to_string(), span)),
|
||||||
|
AnyValue::UInt8(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::UInt16(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::UInt32(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::UInt64(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::Int8(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::Int16(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::Int32(i) => Ok(Value::int(*i as i64, span)),
|
||||||
|
AnyValue::Int64(i) => Ok(Value::int(*i, span)),
|
||||||
|
AnyValue::Float32(f) => Ok(Value::float(*f as f64, span)),
|
||||||
|
AnyValue::Float64(f) => Ok(Value::float(*f, span)),
|
||||||
|
AnyValue::Date(d) => {
|
||||||
|
let nanos = nanos_per_day(*d);
|
||||||
|
datetime_from_epoch_nanos(nanos, &None, span)
|
||||||
|
.map(|datetime| Value::date(datetime, span))
|
||||||
|
}
|
||||||
|
AnyValue::Datetime(a, time_unit, tz) => {
|
||||||
|
let nanos = nanos_from_timeunit(*a, *time_unit);
|
||||||
|
datetime_from_epoch_nanos(nanos, tz, span).map(|datetime| Value::date(datetime, span))
|
||||||
|
}
|
||||||
|
AnyValue::Duration(a, time_unit) => {
|
||||||
|
let nanos = match time_unit {
|
||||||
|
TimeUnit::Nanoseconds => *a,
|
||||||
|
TimeUnit::Microseconds => *a * 1_000,
|
||||||
|
TimeUnit::Milliseconds => *a * 1_000_000,
|
||||||
|
};
|
||||||
|
Ok(Value::duration(nanos, span))
|
||||||
|
}
|
||||||
|
// AnyValue::Time represents the current time since midnight.
|
||||||
|
// Unfortunately, there is no timezone related information.
|
||||||
|
// Given this, calculate the current date from UTC and add the time.
|
||||||
|
AnyValue::Time(nanos) => time_from_midnight(*nanos, span),
|
||||||
|
AnyValue::List(series) => {
|
||||||
|
series_to_values(series, None, None, span).map(|values| Value::list(values, span))
|
||||||
|
}
|
||||||
|
AnyValue::Struct(_idx, _struct_array, _s_fields) => {
|
||||||
|
// This should convert to a StructOwned object.
|
||||||
|
let static_value =
|
||||||
|
any_value
|
||||||
|
.clone()
|
||||||
|
.into_static()
|
||||||
|
.map_err(|e| ShellError::GenericError {
|
||||||
|
error: "Cannot convert polars struct to static value".into(),
|
||||||
|
msg: e.to_string(),
|
||||||
|
span: Some(span),
|
||||||
|
help: None,
|
||||||
|
inner: Vec::new(),
|
||||||
|
})?;
|
||||||
|
any_value_to_value(&static_value, span)
|
||||||
|
}
|
||||||
|
AnyValue::StructOwned(struct_tuple) => {
|
||||||
|
let values: Result<Vec<Value>, ShellError> = struct_tuple
|
||||||
|
.0
|
||||||
|
.iter()
|
||||||
|
.map(|s| any_value_to_value(s, span))
|
||||||
|
.collect();
|
||||||
|
let fields = struct_tuple
|
||||||
|
.1
|
||||||
|
.iter()
|
||||||
|
.map(|f| f.name().to_string())
|
||||||
|
.collect();
|
||||||
|
Ok(Value::Record {
|
||||||
|
val: Record::from_raw_cols_vals(fields, values?),
|
||||||
|
internal_span: span,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
AnyValue::Utf8Owned(s) => Ok(Value::string(s.to_string(), span)),
|
||||||
|
AnyValue::Binary(bytes) => Ok(Value::binary(*bytes, span)),
|
||||||
|
AnyValue::BinaryOwned(bytes) => Ok(Value::binary(bytes.to_owned(), span)),
|
||||||
|
e => Err(ShellError::GenericError {
|
||||||
|
error: "Error creating Value".into(),
|
||||||
|
msg: "".to_string(),
|
||||||
|
span: None,
|
||||||
|
help: Some(format!("Value not supported in nushell: {e}")),
|
||||||
|
inner: Vec::new(),
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn nanos_per_day(days: i32) -> i64 {
|
||||||
|
days as i64 * NANOS_PER_DAY
|
||||||
|
}
|
||||||
|
|
||||||
|
fn nanos_from_timeunit(a: i64, time_unit: TimeUnit) -> i64 {
|
||||||
|
a * match time_unit {
|
||||||
|
TimeUnit::Microseconds => 1_000, // Convert microseconds to nanoseconds
|
||||||
|
TimeUnit::Milliseconds => 1_000_000, // Convert milliseconds to nanoseconds
|
||||||
|
TimeUnit::Nanoseconds => 1, // Already in nanoseconds
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn datetime_from_epoch_nanos(
|
||||||
|
nanos: i64,
|
||||||
|
timezone: &Option<String>,
|
||||||
|
span: Span,
|
||||||
|
) -> Result<DateTime<FixedOffset>, ShellError> {
|
||||||
|
let tz: Tz = if let Some(polars_tz) = timezone {
|
||||||
|
polars_tz
|
||||||
|
.parse::<Tz>()
|
||||||
|
.map_err(|_| ShellError::GenericError {
|
||||||
|
error: format!("Could not parse polars timezone: {polars_tz}"),
|
||||||
|
msg: "".to_string(),
|
||||||
|
span: Some(span),
|
||||||
|
help: None,
|
||||||
|
inner: vec![],
|
||||||
|
})?
|
||||||
|
} else {
|
||||||
|
Tz::UTC
|
||||||
|
};
|
||||||
|
|
||||||
|
Ok(tz.timestamp_nanos(nanos).fixed_offset())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn time_from_midnight(nanos: i64, span: Span) -> Result<Value, ShellError> {
|
||||||
|
let today = Utc::now().date_naive();
|
||||||
|
NaiveTime::from_hms_opt(0, 0, 0) // midnight
|
||||||
|
.map(|time| time + Duration::nanoseconds(nanos)) // current time
|
||||||
|
.map(|time| today.and_time(time)) // current date and time
|
||||||
|
.and_then(|datetime| {
|
||||||
|
FixedOffset::east_opt(0) // utc
|
||||||
|
.map(|offset| {
|
||||||
|
DateTime::<FixedOffset>::from_naive_utc_and_offset(datetime, offset)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.map(|datetime| Value::date(datetime, span)) // current date and time
|
||||||
|
.ok_or(ShellError::CantConvert {
|
||||||
|
to_type: "datetime".to_string(),
|
||||||
|
from_type: "polars time".to_string(),
|
||||||
|
span,
|
||||||
|
help: Some("Could not convert polars time of {nanos} to datetime".to_string()),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
|
||||||
use indexmap::indexmap;
|
use indexmap::indexmap;
|
||||||
|
use nu_protocol::record;
|
||||||
|
use polars::export::arrow::array::{BooleanArray, PrimitiveArray};
|
||||||
|
use polars::prelude::Field;
|
||||||
|
use polars_io::prelude::StructArray;
|
||||||
|
|
||||||
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parsed_column_string_list() -> Result<(), Box<dyn std::error::Error>> {
|
fn test_parsed_column_string_list() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@ -1001,4 +1096,181 @@ mod tests {
|
|||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_any_value_to_value() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let span = Span::test_data();
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Null, span)?,
|
||||||
|
Value::nothing(span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_bool = true;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Boolean(test_bool), span)?,
|
||||||
|
Value::bool(test_bool, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_str = "foo";
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Utf8(test_str), span)?,
|
||||||
|
Value::string(test_str.to_string(), span)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Utf8Owned(test_str.into()), span)?,
|
||||||
|
Value::string(test_str.to_owned(), span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_uint8 = 4;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::UInt8(tests_uint8), span)?,
|
||||||
|
Value::int(tests_uint8 as i64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_uint16 = 233;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::UInt16(tests_uint16), span)?,
|
||||||
|
Value::int(tests_uint16 as i64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_uint32 = 897688233;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::UInt32(tests_uint32), span)?,
|
||||||
|
Value::int(tests_uint32 as i64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_uint64 = 903225135897388233;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::UInt64(tests_uint64), span)?,
|
||||||
|
Value::int(tests_uint64 as i64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_float32 = 903225135897388233.3223353;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Float32(tests_float32), span)?,
|
||||||
|
Value::float(tests_float32 as f64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let tests_float64 = 9064251358973882322333.64233533232;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Float64(tests_float64), span)?,
|
||||||
|
Value::float(tests_float64, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_days = 10_957;
|
||||||
|
let comparison_date = Utc
|
||||||
|
.with_ymd_and_hms(2000, 1, 1, 0, 0, 0)
|
||||||
|
.unwrap()
|
||||||
|
.fixed_offset();
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Date(test_days), span)?,
|
||||||
|
Value::date(comparison_date, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_millis = 946_684_800_000;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(
|
||||||
|
&AnyValue::Datetime(test_millis, TimeUnit::Milliseconds, &None),
|
||||||
|
span
|
||||||
|
)?,
|
||||||
|
Value::date(comparison_date, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_duration_millis = 99_999;
|
||||||
|
let test_duration_micros = 99_999_000;
|
||||||
|
let test_duration_nanos = 99_999_000_000;
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(
|
||||||
|
&AnyValue::Duration(test_duration_nanos, TimeUnit::Nanoseconds),
|
||||||
|
span
|
||||||
|
)?,
|
||||||
|
Value::duration(test_duration_nanos, span)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(
|
||||||
|
&AnyValue::Duration(test_duration_micros, TimeUnit::Microseconds),
|
||||||
|
span
|
||||||
|
)?,
|
||||||
|
Value::duration(test_duration_nanos, span)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(
|
||||||
|
&AnyValue::Duration(test_duration_millis, TimeUnit::Milliseconds),
|
||||||
|
span
|
||||||
|
)?,
|
||||||
|
Value::duration(test_duration_nanos, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_binary = b"sdf2332f32q3f3afwaf3232f32";
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Binary(test_binary), span)?,
|
||||||
|
Value::binary(test_binary.to_vec(), span)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::BinaryOwned(test_binary.to_vec()), span)?,
|
||||||
|
Value::binary(test_binary.to_vec(), span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_time_nanos = 54_000_000_000_000;
|
||||||
|
let test_time = DateTime::<FixedOffset>::from_naive_utc_and_offset(
|
||||||
|
Utc::now()
|
||||||
|
.date_naive()
|
||||||
|
.and_time(NaiveTime::from_hms_opt(15, 00, 00).unwrap()),
|
||||||
|
FixedOffset::east_opt(0).unwrap(),
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::Time(test_time_nanos), span)?,
|
||||||
|
Value::date(test_time, span)
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_list_series = Series::new("int series", &[1, 2, 3]);
|
||||||
|
let comparison_list_series = Value::list(
|
||||||
|
vec![
|
||||||
|
Value::int(1, span),
|
||||||
|
Value::int(2, span),
|
||||||
|
Value::int(3, span),
|
||||||
|
],
|
||||||
|
span,
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&AnyValue::List(test_list_series), span)?,
|
||||||
|
comparison_list_series
|
||||||
|
);
|
||||||
|
|
||||||
|
let field_value_0 = AnyValue::Int32(1);
|
||||||
|
let field_value_1 = AnyValue::Boolean(true);
|
||||||
|
let values = vec![field_value_0, field_value_1];
|
||||||
|
let field_name_0 = "num_field";
|
||||||
|
let field_name_1 = "bool_field";
|
||||||
|
let fields = vec![
|
||||||
|
Field::new(field_name_0, DataType::Int32),
|
||||||
|
Field::new(field_name_1, DataType::Boolean),
|
||||||
|
];
|
||||||
|
let test_owned_struct = AnyValue::StructOwned(Box::new((values, fields.clone())));
|
||||||
|
let comparison_owned_record = Value::test_record(record!(
|
||||||
|
field_name_0 => Value::int(1, span),
|
||||||
|
field_name_1 => Value::bool(true, span),
|
||||||
|
));
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(&test_owned_struct, span)?,
|
||||||
|
comparison_owned_record.clone()
|
||||||
|
);
|
||||||
|
|
||||||
|
let test_int_arr = PrimitiveArray::from([Some(1_i32)]);
|
||||||
|
let test_bool_arr = BooleanArray::from([Some(true)]);
|
||||||
|
let test_struct_arr = StructArray::new(
|
||||||
|
DataType::Struct(fields.clone()).to_arrow(),
|
||||||
|
vec![Box::new(test_int_arr), Box::new(test_bool_arr)],
|
||||||
|
None,
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
any_value_to_value(
|
||||||
|
&AnyValue::Struct(0, &test_struct_arr, fields.as_slice()),
|
||||||
|
span
|
||||||
|
)?,
|
||||||
|
comparison_owned_record
|
||||||
|
);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,10 @@ impl NuDataFrame {
|
|||||||
.map(|i| format!("{i}"))
|
.map(|i| format!("{i}"))
|
||||||
.collect::<Vec<String>>();
|
.collect::<Vec<String>>();
|
||||||
|
|
||||||
conversion::insert_record(&mut column_values, Record { cols, vals })?
|
conversion::insert_record(
|
||||||
|
&mut column_values,
|
||||||
|
Record::from_raw_cols_vals(cols, vals),
|
||||||
|
)?
|
||||||
}
|
}
|
||||||
Value::Record { val: record, .. } => {
|
Value::Record { val: record, .. } => {
|
||||||
conversion::insert_record(&mut column_values, record)?
|
conversion::insert_record(&mut column_values, record)?
|
||||||
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-cmd-extra"
|
name = "nu-cmd-extra"
|
||||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-extra"
|
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-extra"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@ -13,22 +13,22 @@ version = "0.88.1"
|
|||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.1" }
|
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.2" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
|
|
||||||
# Potential dependencies for extras
|
# Potential dependencies for extras
|
||||||
heck = "0.4.1"
|
heck = "0.4.1"
|
||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
ahash = "0.8.3"
|
ahash = "0.8.3"
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
fancy-regex = "0.11.0"
|
fancy-regex = "0.12.0"
|
||||||
rust-embed = "8.0.0"
|
rust-embed = "8.0.0"
|
||||||
serde = "1.0.164"
|
serde = "1.0.164"
|
||||||
nu-pretty-hex = { version = "0.88.1", path = "../nu-pretty-hex" }
|
nu-pretty-hex = { version = "0.88.2", path = "../nu-pretty-hex" }
|
||||||
nu-json = { version = "0.88.1", path = "../nu-json" }
|
nu-json = { version = "0.88.2", path = "../nu-json" }
|
||||||
serde_urlencoded = "0.7.1"
|
serde_urlencoded = "0.7.1"
|
||||||
htmlescape = "0.3.1"
|
htmlescape = "0.3.1"
|
||||||
|
|
||||||
@ -37,6 +37,6 @@ extra = ["default"]
|
|||||||
default = []
|
default = []
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.1" }
|
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.2" }
|
||||||
nu-command = { path = "../nu-command", version = "0.88.1" }
|
nu-command = { path = "../nu-command", version = "0.88.2" }
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
|
@ -65,7 +65,7 @@ pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState {
|
|||||||
bind_command!(platform::ansi::Gradient);
|
bind_command!(platform::ansi::Gradient);
|
||||||
|
|
||||||
bind_command!(
|
bind_command!(
|
||||||
strings::format::Format,
|
strings::format::FormatPattern,
|
||||||
strings::encode_decode::EncodeHex,
|
strings::encode_decode::EncodeHex,
|
||||||
strings::encode_decode::DecodeHex,
|
strings::encode_decode::DecodeHex,
|
||||||
strings::str_::case::Str,
|
strings::str_::case::Str,
|
||||||
|
@ -10,15 +10,15 @@ use nu_protocol::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct Format;
|
pub struct FormatPattern;
|
||||||
|
|
||||||
impl Command for Format {
|
impl Command for FormatPattern {
|
||||||
fn name(&self) -> &str {
|
fn name(&self) -> &str {
|
||||||
"format"
|
"format pattern"
|
||||||
}
|
}
|
||||||
|
|
||||||
fn signature(&self) -> Signature {
|
fn signature(&self) -> Signature {
|
||||||
Signature::build("format")
|
Signature::build("format pattern")
|
||||||
.input_output_types(vec![
|
.input_output_types(vec![
|
||||||
(Type::Table(vec![]), Type::List(Box::new(Type::String))),
|
(Type::Table(vec![]), Type::List(Box::new(Type::String))),
|
||||||
(Type::Record(vec![]), Type::Any),
|
(Type::Record(vec![]), Type::Any),
|
||||||
@ -80,12 +80,12 @@ impl Command for Format {
|
|||||||
vec![
|
vec![
|
||||||
Example {
|
Example {
|
||||||
description: "Print filenames with their sizes",
|
description: "Print filenames with their sizes",
|
||||||
example: "ls | format '{name}: {size}'",
|
example: "ls | format pattern '{name}: {size}'",
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Print elements from some columns of a table",
|
description: "Print elements from some columns of a table",
|
||||||
example: "[[col1, col2]; [v1, v2] [v3, v4]] | format '{col2}'",
|
example: "[[col1, col2]; [v1, v2] [v3, v4]] | format pattern '{col2}'",
|
||||||
result: Some(Value::list(
|
result: Some(Value::list(
|
||||||
vec![Value::test_string("v2"), Value::test_string("v4")],
|
vec![Value::test_string("v2"), Value::test_string("v4")],
|
||||||
Span::test_data(),
|
Span::test_data(),
|
||||||
@ -318,8 +318,8 @@ fn format_record(
|
|||||||
mod test {
|
mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_examples() {
|
fn test_examples() {
|
||||||
use super::Format;
|
use super::FormatPattern;
|
||||||
use crate::test_examples;
|
use crate::test_examples;
|
||||||
test_examples(Format {})
|
test_examples(FormatPattern {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
mod command;
|
mod command;
|
||||||
|
|
||||||
pub(crate) use command::Format;
|
pub(crate) use command::FormatPattern;
|
||||||
|
@ -6,24 +6,24 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-cmd-lang"
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-cmd-lang"
|
name = "nu-cmd-lang"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
|
|
||||||
fancy-regex = "0.11"
|
fancy-regex = "0.12"
|
||||||
itertools = "0.11"
|
itertools = "0.12"
|
||||||
shadow-rs = { version = "0.24", default-features = false }
|
shadow-rs = { version = "0.25", default-features = false }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
shadow-rs = { version = "0.24", default-features = false }
|
shadow-rs = { version = "0.25", default-features = false }
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
mimalloc = []
|
mimalloc = []
|
||||||
|
@ -19,11 +19,11 @@ impl Command for Alias {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("alias")
|
Signature::build("alias")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("name", SyntaxShape::String, "name of the alias")
|
.required("name", SyntaxShape::String, "Name of the alias.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
||||||
"equals sign followed by value",
|
"Equals sign followed by value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ impl Command for Collect {
|
|||||||
.required(
|
.required(
|
||||||
"closure",
|
"closure",
|
||||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||||
"the closure to run once the stream is collected",
|
"The closure to run once the stream is collected.",
|
||||||
)
|
)
|
||||||
.switch(
|
.switch(
|
||||||
"keep-env",
|
"keep-env",
|
||||||
|
@ -18,11 +18,11 @@ impl Command for Const {
|
|||||||
Signature::build("const")
|
Signature::build("const")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("const_name", SyntaxShape::VarWithOptType, "constant name")
|
.required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||||
"equals sign followed by constant value",
|
"Equals sign followed by constant value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ impl Command for Def {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("def")
|
Signature::build("def")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("def_name", SyntaxShape::String, "command name")
|
.required("def_name", SyntaxShape::String, "Command name.")
|
||||||
.required("params", SyntaxShape::Signature, "parameters")
|
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||||
.required("block", SyntaxShape::Closure(None), "body of the definition")
|
.required("block", SyntaxShape::Closure(None), "Body of the definition.")
|
||||||
.switch("env", "keep the environment defined inside the command", None)
|
.switch("env", "keep the environment defined inside the command", None)
|
||||||
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
|
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
|
@ -290,7 +290,6 @@ fn describe_value(
|
|||||||
| Value::Date { .. }
|
| Value::Date { .. }
|
||||||
| Value::Range { .. }
|
| Value::Range { .. }
|
||||||
| Value::String { .. }
|
| Value::String { .. }
|
||||||
| Value::MatchPattern { .. }
|
|
||||||
| Value::Nothing { .. } => Value::record(
|
| Value::Nothing { .. } => Value::record(
|
||||||
record!(
|
record!(
|
||||||
"type" => Value::string(value.get_type().to_string(), head),
|
"type" => Value::string(value.get_type().to_string(), head),
|
||||||
|
@ -25,7 +25,7 @@ impl Command for Do {
|
|||||||
.required(
|
.required(
|
||||||
"closure",
|
"closure",
|
||||||
SyntaxShape::OneOf(vec![SyntaxShape::Closure(None), SyntaxShape::Any]),
|
SyntaxShape::OneOf(vec![SyntaxShape::Closure(None), SyntaxShape::Any]),
|
||||||
"the closure to run",
|
"The closure to run.",
|
||||||
)
|
)
|
||||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||||
.switch(
|
.switch(
|
||||||
@ -53,7 +53,11 @@ impl Command for Do {
|
|||||||
"keep the environment defined inside the command",
|
"keep the environment defined inside the command",
|
||||||
None,
|
None,
|
||||||
)
|
)
|
||||||
.rest("rest", SyntaxShape::Any, "the parameter(s) for the closure")
|
.rest(
|
||||||
|
"rest",
|
||||||
|
SyntaxShape::Any,
|
||||||
|
"The parameter(s) for the closure.",
|
||||||
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ impl Command for Echo {
|
|||||||
fn signature(&self) -> Signature {
|
fn signature(&self) -> Signature {
|
||||||
Signature::build("echo")
|
Signature::build("echo")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
||||||
.rest("rest", SyntaxShape::Any, "the values to echo")
|
.rest("rest", SyntaxShape::Any, "The values to echo.")
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ impl Command for ErrorMake {
|
|||||||
.required(
|
.required(
|
||||||
"error_struct",
|
"error_struct",
|
||||||
SyntaxShape::Record(vec![]),
|
SyntaxShape::Record(vec![]),
|
||||||
"the error to create",
|
"The error to create.",
|
||||||
)
|
)
|
||||||
.switch(
|
.switch(
|
||||||
"unspanned",
|
"unspanned",
|
||||||
|
@ -19,11 +19,11 @@ impl Command for ExportAlias {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("export alias")
|
Signature::build("export alias")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("name", SyntaxShape::String, "name of the alias")
|
.required("name", SyntaxShape::String, "Name of the alias.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::Expression)),
|
||||||
"equals sign followed by value",
|
"Equals sign followed by value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,11 @@ impl Command for ExportConst {
|
|||||||
Signature::build("export const")
|
Signature::build("export const")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("const_name", SyntaxShape::VarWithOptType, "constant name")
|
.required("const_name", SyntaxShape::VarWithOptType, "Constant name.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||||
"equals sign followed by constant value",
|
"Equals sign followed by constant value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -19,9 +19,9 @@ impl Command for ExportDef {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("export def")
|
Signature::build("export def")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("def_name", SyntaxShape::String, "command name")
|
.required("def_name", SyntaxShape::String, "Command name.")
|
||||||
.required("params", SyntaxShape::Signature, "parameters")
|
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||||
.required("block", SyntaxShape::Block, "body of the definition")
|
.required("block", SyntaxShape::Block, "Body of the definition.")
|
||||||
.switch("env", "keep the environment defined inside the command", None)
|
.switch("env", "keep the environment defined inside the command", None)
|
||||||
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
|
.switch("wrapped", "treat unknown flags and arguments as strings (requires ...rest-like parameter in signature)", None)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
|
@ -17,8 +17,8 @@ impl Command for ExportExtern {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("export extern")
|
Signature::build("export extern")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("def_name", SyntaxShape::String, "definition name")
|
.required("def_name", SyntaxShape::String, "Definition name.")
|
||||||
.required("params", SyntaxShape::Signature, "parameters")
|
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ impl Command for ExportModule {
|
|||||||
Signature::build("export module")
|
Signature::build("export module")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("module", SyntaxShape::String, "module name or module path")
|
.required("module", SyntaxShape::String, "Module name or module path.")
|
||||||
.optional(
|
.optional(
|
||||||
"block",
|
"block",
|
||||||
SyntaxShape::Block,
|
SyntaxShape::Block,
|
||||||
"body of the module if 'module' parameter is not a path",
|
"Body of the module if 'module' parameter is not a path.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@ impl Command for ExportUse {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("export use")
|
Signature::build("export use")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("module", SyntaxShape::String, "Module or module file")
|
.required("module", SyntaxShape::String, "Module or module file.")
|
||||||
.optional(
|
.optional(
|
||||||
"members",
|
"members",
|
||||||
SyntaxShape::Any,
|
SyntaxShape::Any,
|
||||||
"Which members of the module to import",
|
"Which members of the module to import.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@ impl Command for Extern {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("extern")
|
Signature::build("extern")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("def_name", SyntaxShape::String, "definition name")
|
.required("def_name", SyntaxShape::String, "Definition name.")
|
||||||
.required("params", SyntaxShape::Signature, "parameters")
|
.required("params", SyntaxShape::Signature, "Parameters.")
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,14 +25,14 @@ impl Command for For {
|
|||||||
.required(
|
.required(
|
||||||
"var_name",
|
"var_name",
|
||||||
SyntaxShape::VarWithOptType,
|
SyntaxShape::VarWithOptType,
|
||||||
"name of the looping variable",
|
"Name of the looping variable.",
|
||||||
)
|
)
|
||||||
.required(
|
.required(
|
||||||
"range",
|
"range",
|
||||||
SyntaxShape::Keyword(b"in".to_vec(), Box::new(SyntaxShape::Any)),
|
SyntaxShape::Keyword(b"in".to_vec(), Box::new(SyntaxShape::Any)),
|
||||||
"range of the loop",
|
"Range of the loop.",
|
||||||
)
|
)
|
||||||
.required("block", SyntaxShape::Block, "the block to run")
|
.required("block", SyntaxShape::Block, "The block to run.")
|
||||||
.switch(
|
.switch(
|
||||||
"numbered",
|
"numbered",
|
||||||
"return a numbered item ($it.index and $it.item)",
|
"return a numbered item ($it.index and $it.item)",
|
||||||
|
@ -13,11 +13,11 @@ impl Command for Hide {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("hide")
|
Signature::build("hide")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.required("module", SyntaxShape::String, "Module or module file")
|
.required("module", SyntaxShape::String, "Module or module file.")
|
||||||
.optional(
|
.optional(
|
||||||
"members",
|
"members",
|
||||||
SyntaxShape::Any,
|
SyntaxShape::Any,
|
||||||
"Which members of the module to import",
|
"Which members of the module to import.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ impl Command for HideEnv {
|
|||||||
.rest(
|
.rest(
|
||||||
"name",
|
"name",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"environment variable names to hide",
|
"Environment variable names to hide.",
|
||||||
)
|
)
|
||||||
.switch(
|
.switch(
|
||||||
"ignore-errors",
|
"ignore-errors",
|
||||||
|
@ -21,11 +21,11 @@ impl Command for If {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("if")
|
Signature::build("if")
|
||||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||||
.required("cond", SyntaxShape::MathExpression, "condition to check")
|
.required("cond", SyntaxShape::MathExpression, "Condition to check.")
|
||||||
.required(
|
.required(
|
||||||
"then_block",
|
"then_block",
|
||||||
SyntaxShape::Block,
|
SyntaxShape::Block,
|
||||||
"block to run if check succeeds",
|
"Block to run if check succeeds.",
|
||||||
)
|
)
|
||||||
.optional(
|
.optional(
|
||||||
"else_expression",
|
"else_expression",
|
||||||
@ -36,7 +36,7 @@ impl Command for If {
|
|||||||
SyntaxShape::Expression,
|
SyntaxShape::Expression,
|
||||||
])),
|
])),
|
||||||
),
|
),
|
||||||
"expression or block to run if check fails",
|
"Expression or block to run when the condition is false.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@ impl Command for Let {
|
|||||||
Signature::build("let")
|
Signature::build("let")
|
||||||
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("var_name", SyntaxShape::VarWithOptType, "variable name")
|
.required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||||
"equals sign followed by value",
|
"Equals sign followed by value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ impl Command for Loop {
|
|||||||
Signature::build("loop")
|
Signature::build("loop")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("block", SyntaxShape::Block, "block to loop")
|
.required("block", SyntaxShape::Block, "Block to loop.")
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,11 +20,11 @@ impl Command for Match {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("match")
|
Signature::build("match")
|
||||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||||
.required("value", SyntaxShape::Any, "value to check")
|
.required("value", SyntaxShape::Any, "Value to check.")
|
||||||
.required(
|
.required(
|
||||||
"match_block",
|
"match_block",
|
||||||
SyntaxShape::MatchBlock,
|
SyntaxShape::MatchBlock,
|
||||||
"block to run if check succeeds",
|
"Block to run if check succeeds.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -20,11 +20,11 @@ impl Command for Module {
|
|||||||
Signature::build("module")
|
Signature::build("module")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("module", SyntaxShape::String, "module name or module path")
|
.required("module", SyntaxShape::String, "Module name or module path.")
|
||||||
.optional(
|
.optional(
|
||||||
"block",
|
"block",
|
||||||
SyntaxShape::Block,
|
SyntaxShape::Block,
|
||||||
"body of the module if 'module' parameter is not a module path",
|
"Body of the module if 'module' parameter is not a module path.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -19,11 +19,11 @@ impl Command for Mut {
|
|||||||
Signature::build("mut")
|
Signature::build("mut")
|
||||||
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
.input_output_types(vec![(Type::Any, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("var_name", SyntaxShape::VarWithOptType, "variable name")
|
.required("var_name", SyntaxShape::VarWithOptType, "Variable name.")
|
||||||
.required(
|
.required(
|
||||||
"initial_value",
|
"initial_value",
|
||||||
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
SyntaxShape::Keyword(b"=".to_vec(), Box::new(SyntaxShape::MathExpression)),
|
||||||
"equals sign followed by value",
|
"Equals sign followed by value.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -20,10 +20,10 @@ impl Command for OverlayHide {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("overlay hide")
|
Signature::build("overlay hide")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.optional("name", SyntaxShape::String, "Overlay to hide")
|
.optional("name", SyntaxShape::String, "Overlay to hide.")
|
||||||
.switch(
|
.switch(
|
||||||
"keep-custom",
|
"keep-custom",
|
||||||
"Keep all newly added commands and aliases in the next activated overlay",
|
"Keep all newly added commands and aliases in the next activated overlay.",
|
||||||
Some('k'),
|
Some('k'),
|
||||||
)
|
)
|
||||||
.named(
|
.named(
|
||||||
|
@ -21,7 +21,7 @@ impl Command for OverlayNew {
|
|||||||
Signature::build("overlay new")
|
Signature::build("overlay new")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("name", SyntaxShape::String, "Name of the overlay")
|
.required("name", SyntaxShape::String, "Name of the overlay.")
|
||||||
// TODO:
|
// TODO:
|
||||||
// .switch(
|
// .switch(
|
||||||
// "prefix",
|
// "prefix",
|
||||||
|
@ -27,12 +27,12 @@ impl Command for OverlayUse {
|
|||||||
.required(
|
.required(
|
||||||
"name",
|
"name",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"Module name to use overlay for",
|
"Module name to use overlay for.",
|
||||||
)
|
)
|
||||||
.optional(
|
.optional(
|
||||||
"as",
|
"as",
|
||||||
SyntaxShape::Keyword(b"as".to_vec(), Box::new(SyntaxShape::String)),
|
SyntaxShape::Keyword(b"as".to_vec(), Box::new(SyntaxShape::String)),
|
||||||
"as keyword followed by a new name",
|
"`as` keyword followed by a new name.",
|
||||||
)
|
)
|
||||||
.switch(
|
.switch(
|
||||||
"prefix",
|
"prefix",
|
||||||
|
@ -20,12 +20,12 @@ impl Command for Register {
|
|||||||
.required(
|
.required(
|
||||||
"plugin",
|
"plugin",
|
||||||
SyntaxShape::Filepath,
|
SyntaxShape::Filepath,
|
||||||
"path of executable for plugin",
|
"Path of executable for plugin.",
|
||||||
)
|
)
|
||||||
.optional(
|
.optional(
|
||||||
"signature",
|
"signature",
|
||||||
SyntaxShape::Any,
|
SyntaxShape::Any,
|
||||||
"Block with signature description as json object",
|
"Block with signature description as json object.",
|
||||||
)
|
)
|
||||||
.named(
|
.named(
|
||||||
"shell",
|
"shell",
|
||||||
|
@ -20,7 +20,11 @@ impl Command for Return {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("return")
|
Signature::build("return")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
.input_output_types(vec![(Type::Nothing, Type::Any)])
|
||||||
.optional("return_value", SyntaxShape::Any, "optional value to return")
|
.optional(
|
||||||
|
"return_value",
|
||||||
|
SyntaxShape::Any,
|
||||||
|
"Optional value to return.",
|
||||||
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ impl Command for Try {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("try")
|
Signature::build("try")
|
||||||
.input_output_types(vec![(Type::Any, Type::Any)])
|
.input_output_types(vec![(Type::Any, Type::Any)])
|
||||||
.required("try_block", SyntaxShape::Block, "block to run")
|
.required("try_block", SyntaxShape::Block, "Block to run.")
|
||||||
.optional(
|
.optional(
|
||||||
"catch_block",
|
"catch_block",
|
||||||
SyntaxShape::Keyword(
|
SyntaxShape::Keyword(
|
||||||
@ -31,7 +31,7 @@ impl Command for Try {
|
|||||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||||
])),
|
])),
|
||||||
),
|
),
|
||||||
"block to run if try block fails",
|
"Block to run if try block fails.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,11 @@ impl Command for Use {
|
|||||||
Signature::build("use")
|
Signature::build("use")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("module", SyntaxShape::String, "Module or module file")
|
.required("module", SyntaxShape::String, "Module or module file.")
|
||||||
.rest(
|
.rest(
|
||||||
"members",
|
"members",
|
||||||
SyntaxShape::Any,
|
SyntaxShape::Any,
|
||||||
"Which members of the module to import",
|
"Which members of the module to import.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,11 @@ impl Command for While {
|
|||||||
Signature::build("while")
|
Signature::build("while")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
.input_output_types(vec![(Type::Nothing, Type::Nothing)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("cond", SyntaxShape::MathExpression, "condition to check")
|
.required("cond", SyntaxShape::MathExpression, "Condition to check.")
|
||||||
.required(
|
.required(
|
||||||
"block",
|
"block",
|
||||||
SyntaxShape::Block,
|
SyntaxShape::Block,
|
||||||
"block to loop if check succeeds",
|
"Block to loop if check succeeds.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
@ -278,9 +278,6 @@ impl<'a> std::fmt::Debug for DebuggableValue<'a> {
|
|||||||
let rec = val.collect().map_err(|_| std::fmt::Error)?;
|
let rec = val.collect().map_err(|_| std::fmt::Error)?;
|
||||||
write!(f, "LazyRecord({:?})", DebuggableValue(&rec))
|
write!(f, "LazyRecord({:?})", DebuggableValue(&rec))
|
||||||
}
|
}
|
||||||
Value::MatchPattern { val, .. } => {
|
|
||||||
write!(f, "MatchPattern({:?})", val)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,19 +5,19 @@ repository = "https://github.com/nushell/nushell/tree/main/crates/nu-color-confi
|
|||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-color-config"
|
name = "nu-color-config"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
bench = false
|
bench = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-json = { path = "../nu-json", version = "0.88.1" }
|
nu-json = { path = "../nu-json", version = "0.88.2" }
|
||||||
|
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
|
@ -92,7 +92,7 @@ fn color_string_to_nustyle(color_string: String) -> Style {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use nu_ansi_term::{Color, Style};
|
use nu_ansi_term::{Color, Style};
|
||||||
use nu_protocol::{Span, Value};
|
use nu_protocol::{record, Span, Value};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_color_string_to_nustyle_empty_string() {
|
fn test_color_string_to_nustyle_empty_string() {
|
||||||
@ -120,13 +120,10 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_get_style_from_value() {
|
fn test_get_style_from_value() {
|
||||||
// Test case 1: all values are valid
|
// Test case 1: all values are valid
|
||||||
let record = Record {
|
let record = record! {
|
||||||
cols: vec!["bg".to_string(), "fg".to_string(), "attr".to_string()],
|
"bg" => Value::test_string("red"),
|
||||||
vals: vec![
|
"fg" => Value::test_string("blue"),
|
||||||
Value::string("red", Span::unknown()),
|
"attr" => Value::test_string("bold"),
|
||||||
Value::string("blue", Span::unknown()),
|
|
||||||
Value::string("bold", Span::unknown()),
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
let expected_style = NuStyle {
|
let expected_style = NuStyle {
|
||||||
bg: Some("red".to_string()),
|
bg: Some("red".to_string()),
|
||||||
@ -136,19 +133,15 @@ mod tests {
|
|||||||
assert_eq!(get_style_from_value(&record), Some(expected_style));
|
assert_eq!(get_style_from_value(&record), Some(expected_style));
|
||||||
|
|
||||||
// Test case 2: no values are valid
|
// Test case 2: no values are valid
|
||||||
let record = Record {
|
let record = record! {
|
||||||
cols: vec!["invalid".to_string()],
|
"invalid" => Value::nothing(Span::test_data()),
|
||||||
vals: vec![Value::nothing(Span::unknown())],
|
|
||||||
};
|
};
|
||||||
assert_eq!(get_style_from_value(&record), None);
|
assert_eq!(get_style_from_value(&record), None);
|
||||||
|
|
||||||
// Test case 3: some values are valid
|
// Test case 3: some values are valid
|
||||||
let record = Record {
|
let record = record! {
|
||||||
cols: vec!["bg".to_string(), "invalid".to_string()],
|
"bg" => Value::test_string("green"),
|
||||||
vals: vec![
|
"invalid" => Value::nothing(Span::unknown()),
|
||||||
Value::string("green", Span::unknown()),
|
|
||||||
Value::nothing(Span::unknown()),
|
|
||||||
],
|
|
||||||
};
|
};
|
||||||
let expected_style = NuStyle {
|
let expected_style = NuStyle {
|
||||||
bg: Some("green".to_string()),
|
bg: Some("green".to_string()),
|
||||||
|
@ -131,8 +131,7 @@ impl<'a> StyleComputer<'a> {
|
|||||||
Value::Closure { .. }
|
Value::Closure { .. }
|
||||||
| Value::CustomValue { .. }
|
| Value::CustomValue { .. }
|
||||||
| Value::Error { .. }
|
| Value::Error { .. }
|
||||||
| Value::LazyRecord { .. }
|
| Value::LazyRecord { .. } => TextStyle::basic_left(),
|
||||||
| Value::MatchPattern { .. } => TextStyle::basic_left(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
name = "nu-command"
|
name = "nu-command"
|
||||||
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-command"
|
repository = "https://github.com/nushell/nushell/tree/main/crates/nu-command"
|
||||||
version = "0.88.1"
|
version = "0.88.2"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@ -14,19 +14,19 @@ bench = false
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
nu-ansi-term = "0.49.0"
|
nu-ansi-term = "0.49.0"
|
||||||
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.1" }
|
nu-cmd-base = { path = "../nu-cmd-base", version = "0.88.2" }
|
||||||
nu-color-config = { path = "../nu-color-config", version = "0.88.1" }
|
nu-color-config = { path = "../nu-color-config", version = "0.88.2" }
|
||||||
nu-engine = { path = "../nu-engine", version = "0.88.1" }
|
nu-engine = { path = "../nu-engine", version = "0.88.2" }
|
||||||
nu-glob = { path = "../nu-glob", version = "0.88.1" }
|
nu-glob = { path = "../nu-glob", version = "0.88.2" }
|
||||||
nu-json = { path = "../nu-json", version = "0.88.1" }
|
nu-json = { path = "../nu-json", version = "0.88.2" }
|
||||||
nu-parser = { path = "../nu-parser", version = "0.88.1" }
|
nu-parser = { path = "../nu-parser", version = "0.88.2" }
|
||||||
nu-path = { path = "../nu-path", version = "0.88.1" }
|
nu-path = { path = "../nu-path", version = "0.88.2" }
|
||||||
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.88.1" }
|
nu-pretty-hex = { path = "../nu-pretty-hex", version = "0.88.2" }
|
||||||
nu-protocol = { path = "../nu-protocol", version = "0.88.1" }
|
nu-protocol = { path = "../nu-protocol", version = "0.88.2" }
|
||||||
nu-system = { path = "../nu-system", version = "0.88.1" }
|
nu-system = { path = "../nu-system", version = "0.88.2" }
|
||||||
nu-table = { path = "../nu-table", version = "0.88.1" }
|
nu-table = { path = "../nu-table", version = "0.88.2" }
|
||||||
nu-term-grid = { path = "../nu-term-grid", version = "0.88.1" }
|
nu-term-grid = { path = "../nu-term-grid", version = "0.88.2" }
|
||||||
nu-utils = { path = "../nu-utils", version = "0.88.1" }
|
nu-utils = { path = "../nu-utils", version = "0.88.2" }
|
||||||
|
|
||||||
alphanumeric-sort = "1.5"
|
alphanumeric-sort = "1.5"
|
||||||
base64 = "0.21"
|
base64 = "0.21"
|
||||||
@ -42,7 +42,7 @@ dialoguer = { default-features = false, features = ["fuzzy-select"], version = "
|
|||||||
digest = { default-features = false, version = "0.10" }
|
digest = { default-features = false, version = "0.10" }
|
||||||
dtparse = "2.0"
|
dtparse = "2.0"
|
||||||
encoding_rs = "0.8"
|
encoding_rs = "0.8"
|
||||||
fancy-regex = "0.11"
|
fancy-regex = "0.12"
|
||||||
filesize = "0.2"
|
filesize = "0.2"
|
||||||
filetime = "0.2"
|
filetime = "0.2"
|
||||||
fs_extra = "1.3"
|
fs_extra = "1.3"
|
||||||
@ -50,9 +50,9 @@ htmlescape = "0.3"
|
|||||||
human-date-parser = "0.1.1"
|
human-date-parser = "0.1.1"
|
||||||
indexmap = "2.1"
|
indexmap = "2.1"
|
||||||
indicatif = "0.17"
|
indicatif = "0.17"
|
||||||
itertools = "0.11"
|
itertools = "0.12"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
lscolors = { version = "0.15", default-features = false, features = ["nu-ansi-term"] }
|
lscolors = { version = "0.16", default-features = false, features = ["nu-ansi-term"] }
|
||||||
md5 = { package = "md-5", version = "0.10" }
|
md5 = { package = "md-5", version = "0.10" }
|
||||||
miette = { version = "5.10", features = ["fancy-no-backtrace"] }
|
miette = { version = "5.10", features = ["fancy-no-backtrace"] }
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
@ -104,9 +104,9 @@ winreg = "0.52"
|
|||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(unix)'.dependencies]
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
umask = "2.1"
|
umask = "2.1"
|
||||||
nix = { version = "0.27", default-features = false, features = ["user"] }
|
nix = { version = "0.27", default-features = false, features = ["user", "resource"] }
|
||||||
|
|
||||||
[target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "android"), not(target_os = "ios")))'.dependencies]
|
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
|
||||||
procfs = "0.16.0"
|
procfs = "0.16.0"
|
||||||
|
|
||||||
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies.trash]
|
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies.trash]
|
||||||
@ -122,7 +122,7 @@ features = [
|
|||||||
"Win32_Security",
|
"Win32_Security",
|
||||||
"Win32_System_Threading",
|
"Win32_System_Threading",
|
||||||
]
|
]
|
||||||
version = "0.48"
|
version = "0.52"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
plugin = ["nu-parser/plugin"]
|
plugin = ["nu-parser/plugin"]
|
||||||
@ -131,8 +131,8 @@ trash-support = ["trash"]
|
|||||||
which-support = ["which"]
|
which-support = ["which"]
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.1" }
|
nu-cmd-lang = { path = "../nu-cmd-lang", version = "0.88.2" }
|
||||||
nu-test-support = { path = "../nu-test-support", version = "0.88.1" }
|
nu-test-support = { path = "../nu-test-support", version = "0.88.2" }
|
||||||
|
|
||||||
dirs-next = "2.0"
|
dirs-next = "2.0"
|
||||||
mockito = { version = "1.2", default-features = false }
|
mockito = { version = "1.2", default-features = false }
|
||||||
|
@ -40,7 +40,7 @@ impl Command for BytesAdd {
|
|||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("data", SyntaxShape::Binary, "the binary to add")
|
.required("data", SyntaxShape::Binary, "The binary to add.")
|
||||||
.named(
|
.named(
|
||||||
"index",
|
"index",
|
||||||
SyntaxShape::Int,
|
SyntaxShape::Int,
|
||||||
@ -51,7 +51,7 @@ impl Command for BytesAdd {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, add bytes to the data at the given cell paths",
|
"For a data structure input, add bytes to the data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -47,11 +47,11 @@ impl Command for BytesAt {
|
|||||||
(Type::Table(vec![]), Type::Table(vec![])),
|
(Type::Table(vec![]), Type::Table(vec![])),
|
||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.required("range", SyntaxShape::Range, "the range to get bytes")
|
.required("range", SyntaxShape::Range, "The range to get bytes.")
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, get bytes from data at the given cell paths",
|
"For a data structure input, get bytes from data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ impl Command for BytesBuild {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("bytes build")
|
Signature::build("bytes build")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::Binary)])
|
.input_output_types(vec![(Type::Nothing, Type::Binary)])
|
||||||
.rest("rest", SyntaxShape::Any, "list of bytes")
|
.rest("rest", SyntaxShape::Any, "List of bytes.")
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ impl Command for BytesCollect {
|
|||||||
.optional(
|
.optional(
|
||||||
"separator",
|
"separator",
|
||||||
SyntaxShape::Binary,
|
SyntaxShape::Binary,
|
||||||
"optional separator to use when creating binary",
|
"Optional separator to use when creating binary.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -33,11 +33,11 @@ impl Command for BytesEndsWith {
|
|||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("pattern", SyntaxShape::Binary, "the pattern to match")
|
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, check if bytes at the given cell paths end with the pattern",
|
"For a data structure input, check if bytes at the given cell paths end with the pattern.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,12 @@ impl Command for BytesIndexOf {
|
|||||||
.required(
|
.required(
|
||||||
"pattern",
|
"pattern",
|
||||||
SyntaxShape::Binary,
|
SyntaxShape::Binary,
|
||||||
"the pattern to find index of",
|
"The pattern to find index of.",
|
||||||
)
|
)
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, find the indexes at the given cell paths",
|
"For a data structure input, find the indexes at the given cell paths.",
|
||||||
)
|
)
|
||||||
.switch("all", "returns all matched index", Some('a'))
|
.switch("all", "returns all matched index", Some('a'))
|
||||||
.switch("end", "search from the end of the binary", Some('e'))
|
.switch("end", "search from the end of the binary", Some('e'))
|
||||||
|
@ -29,7 +29,7 @@ impl Command for BytesLen {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, find the length of data at the given cell paths",
|
"For a data structure input, find the length of data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -35,11 +35,11 @@ impl Command for BytesRemove {
|
|||||||
(Type::Table(vec![]), Type::Table(vec![])),
|
(Type::Table(vec![]), Type::Table(vec![])),
|
||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.required("pattern", SyntaxShape::Binary, "the pattern to find")
|
.required("pattern", SyntaxShape::Binary, "The pattern to find.")
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, remove bytes from data at the given cell paths",
|
"For a data structure input, remove bytes from data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.switch("end", "remove from end of binary", Some('e'))
|
.switch("end", "remove from end of binary", Some('e'))
|
||||||
.switch("all", "remove occurrences of finding binary", Some('a'))
|
.switch("all", "remove occurrences of finding binary", Some('a'))
|
||||||
|
@ -36,12 +36,12 @@ impl Command for BytesReplace {
|
|||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("find", SyntaxShape::Binary, "the pattern to find")
|
.required("find", SyntaxShape::Binary, "The pattern to find.")
|
||||||
.required("replace", SyntaxShape::Binary, "the replacement pattern")
|
.required("replace", SyntaxShape::Binary, "The replacement pattern.")
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, replace bytes in data at the given cell paths",
|
"For a data structure input, replace bytes in data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.switch("all", "replace all occurrences of find binary", Some('a'))
|
.switch("all", "replace all occurrences of find binary", Some('a'))
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
|
@ -26,7 +26,7 @@ impl Command for BytesReverse {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, reverse data at the given cell paths",
|
"For a data structure input, reverse data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -35,11 +35,11 @@ impl Command for BytesStartsWith {
|
|||||||
(Type::Record(vec![]), Type::Record(vec![])),
|
(Type::Record(vec![]), Type::Record(vec![])),
|
||||||
])
|
])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.required("pattern", SyntaxShape::Binary, "the pattern to match")
|
.required("pattern", SyntaxShape::Binary, "The pattern to match.")
|
||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, check if bytes at the given cell paths start with the pattern",
|
"For a data structure input, check if bytes at the given cell paths start with the pattern.",
|
||||||
)
|
)
|
||||||
.category(Category::Bytes)
|
.category(Category::Bytes)
|
||||||
}
|
}
|
||||||
|
@ -25,8 +25,8 @@ impl Command for Histogram {
|
|||||||
fn signature(&self) -> Signature {
|
fn signature(&self) -> Signature {
|
||||||
Signature::build("histogram")
|
Signature::build("histogram")
|
||||||
.input_output_types(vec![(Type::List(Box::new(Type::Any)), Type::Table(vec![])),])
|
.input_output_types(vec![(Type::List(Box::new(Type::Any)), Type::Table(vec![])),])
|
||||||
.optional("column-name", SyntaxShape::String, "column name to calc frequency, no need to provide if input is just a list")
|
.optional("column-name", SyntaxShape::String, "Column name to calc frequency, no need to provide if input is a list.")
|
||||||
.optional("frequency-column-name", SyntaxShape::String, "histogram's frequency column, default to be frequency column output")
|
.optional("frequency-column-name", SyntaxShape::String, "Histogram's frequency column, default to be frequency column output.")
|
||||||
.named("percentage-type", SyntaxShape::String, "percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize'", Some('t'))
|
.named("percentage-type", SyntaxShape::String, "percentage calculate method, can be 'normalize' or 'relative', in 'normalize', defaults to be 'normalize'", Some('t'))
|
||||||
.category(Category::Chart)
|
.category(Category::Chart)
|
||||||
}
|
}
|
||||||
@ -258,16 +258,16 @@ fn histogram_impl(
|
|||||||
result.push((
|
result.push((
|
||||||
count, // attach count first for easily sorting.
|
count, // attach count first for easily sorting.
|
||||||
Value::record(
|
Value::record(
|
||||||
Record {
|
Record::from_raw_cols_vals(
|
||||||
cols: result_cols.clone(),
|
result_cols.clone(),
|
||||||
vals: vec![
|
vec![
|
||||||
val.into_value(),
|
val.into_value(),
|
||||||
Value::int(count, span),
|
Value::int(count, span),
|
||||||
Value::float(quantile, span),
|
Value::float(quantile, span),
|
||||||
Value::string(percentage, span),
|
Value::string(percentage, span),
|
||||||
Value::string(freq, span),
|
Value::string(freq, span),
|
||||||
],
|
],
|
||||||
},
|
),
|
||||||
span,
|
span,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
@ -44,7 +44,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
|
@ -81,7 +81,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.category(Category::Conversions)
|
.category(Category::Conversions)
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ impl Command for SubCommand {
|
|||||||
.rest(
|
.rest(
|
||||||
"rest",
|
"rest",
|
||||||
SyntaxShape::CellPath,
|
SyntaxShape::CellPath,
|
||||||
"for a data structure input, convert data at the given cell paths",
|
"For a data structure input, convert data at the given cell paths.",
|
||||||
)
|
)
|
||||||
.named(
|
.named(
|
||||||
"decimals",
|
"decimals",
|
||||||
|
@ -25,7 +25,7 @@ impl Command for IntoSqliteDb {
|
|||||||
.required(
|
.required(
|
||||||
"file_name",
|
"file_name",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"Specify the filename to save the database to",
|
"Specify the filename to save the database to.",
|
||||||
)
|
)
|
||||||
.named(
|
.named(
|
||||||
"table_name",
|
"table_name",
|
||||||
@ -260,7 +260,6 @@ fn nu_value_to_string(value: Value, separator: &str) -> String {
|
|||||||
Value::Binary { val, .. } => format!("{val:?}"),
|
Value::Binary { val, .. } => format!("{val:?}"),
|
||||||
Value::CellPath { val, .. } => val.to_string(),
|
Value::CellPath { val, .. } => val.to_string(),
|
||||||
Value::CustomValue { val, .. } => val.value_string(),
|
Value::CustomValue { val, .. } => val.value_string(),
|
||||||
Value::MatchPattern { val, .. } => format!("{:?}", val),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ impl Command for QueryDb {
|
|||||||
.required(
|
.required(
|
||||||
"SQL",
|
"SQL",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"SQL to execute against the database",
|
"SQL to execute against the database.",
|
||||||
)
|
)
|
||||||
.category(Category::Database)
|
.category(Category::Database)
|
||||||
}
|
}
|
||||||
|
@ -499,13 +499,7 @@ pub fn convert_sqlite_row_to_nu_value(row: &Row, span: Span, column_names: Vec<S
|
|||||||
vals.push(val);
|
vals.push(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value::record(
|
Value::record(Record::from_raw_cols_vals(column_names, vals), span)
|
||||||
Record {
|
|
||||||
cols: column_names,
|
|
||||||
vals,
|
|
||||||
},
|
|
||||||
span,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn convert_sqlite_value_to_nu_value(value: ValueRef, span: Span) -> Value {
|
pub fn convert_sqlite_value_to_nu_value(value: ValueRef, span: Span) -> Value {
|
||||||
|
@ -22,7 +22,7 @@ impl Command for SubCommand {
|
|||||||
Signature::build("date to-timezone")
|
Signature::build("date to-timezone")
|
||||||
.input_output_types(vec![(Type::Date, Type::Date), (Type::String, Type::Date)])
|
.input_output_types(vec![(Type::Date, Type::Date), (Type::String, Type::Date)])
|
||||||
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
|
.allow_variants_without_examples(true) // https://github.com/nushell/nushell/issues/7032
|
||||||
.required("time zone", SyntaxShape::String, "time zone description")
|
.required("time zone", SyntaxShape::String, "Time zone description.")
|
||||||
.category(Category::Date)
|
.category(Category::Date)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ impl Command for Ast {
|
|||||||
.required(
|
.required(
|
||||||
"pipeline",
|
"pipeline",
|
||||||
SyntaxShape::String,
|
SyntaxShape::String,
|
||||||
"the pipeline to print the ast for",
|
"The pipeline to print the ast for.",
|
||||||
)
|
)
|
||||||
.switch("json", "serialize to json", Some('j'))
|
.switch("json", "serialize to json", Some('j'))
|
||||||
.switch("minify", "minify the nuon or json output", Some('m'))
|
.switch("minify", "minify the nuon or json output", Some('m'))
|
||||||
|
@ -23,7 +23,7 @@ impl Command for Explain {
|
|||||||
.required(
|
.required(
|
||||||
"closure",
|
"closure",
|
||||||
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
SyntaxShape::Closure(Some(vec![SyntaxShape::Any])),
|
||||||
"the closure to run",
|
"The closure to run.",
|
||||||
)
|
)
|
||||||
.input_output_types(vec![(Type::Any, Type::Any), (Type::Nothing, Type::Any)])
|
.input_output_types(vec![(Type::Any, Type::Any), (Type::Nothing, Type::Any)])
|
||||||
.allow_variants_without_examples(true)
|
.allow_variants_without_examples(true)
|
||||||
@ -259,6 +259,5 @@ pub fn debug_string_without_formatting(value: &Value) -> String {
|
|||||||
Value::Binary { val, .. } => format!("{val:?}"),
|
Value::Binary { val, .. } => format!("{val:?}"),
|
||||||
Value::CellPath { val, .. } => val.to_string(),
|
Value::CellPath { val, .. } => val.to_string(),
|
||||||
Value::CustomValue { val, .. } => val.value_string(),
|
Value::CustomValue { val, .. } => val.value_string(),
|
||||||
Value::MatchPattern { val, .. } => format!("{:?}", val),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ impl Command for Metadata {
|
|||||||
.optional(
|
.optional(
|
||||||
"expression",
|
"expression",
|
||||||
SyntaxShape::Any,
|
SyntaxShape::Any,
|
||||||
"the expression you want metadata for",
|
"The expression you want metadata for.",
|
||||||
)
|
)
|
||||||
.category(Category::Debug)
|
.category(Category::Debug)
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ impl Command for TimeIt {
|
|||||||
.required(
|
.required(
|
||||||
"command",
|
"command",
|
||||||
SyntaxShape::OneOf(vec![SyntaxShape::Block, SyntaxShape::Expression]),
|
SyntaxShape::OneOf(vec![SyntaxShape::Block, SyntaxShape::Expression]),
|
||||||
"the command or block to run",
|
"The command or block to run.",
|
||||||
)
|
)
|
||||||
.input_output_types(vec![
|
.input_output_types(vec![
|
||||||
(Type::Any, Type::Duration),
|
(Type::Any, Type::Duration),
|
||||||
|
@ -22,7 +22,7 @@ impl Command for ViewSource {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("view source")
|
Signature::build("view source")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||||
.required("item", SyntaxShape::Any, "name or block to view")
|
.required("item", SyntaxShape::Any, "Name or block to view.")
|
||||||
.category(Category::Debug)
|
.category(Category::Debug)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,8 +25,8 @@ impl Command for ViewSpan {
|
|||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
Signature::build("view span")
|
Signature::build("view span")
|
||||||
.input_output_types(vec![(Type::Nothing, Type::String)])
|
.input_output_types(vec![(Type::Nothing, Type::String)])
|
||||||
.required("start", SyntaxShape::Int, "start of the span")
|
.required("start", SyntaxShape::Int, "Start of the span.")
|
||||||
.required("end", SyntaxShape::Int, "end of the span")
|
.required("end", SyntaxShape::Int, "End of the span.")
|
||||||
.category(Category::Debug)
|
.category(Category::Debug)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -191,6 +191,7 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
|
|||||||
StrSubstring,
|
StrSubstring,
|
||||||
StrTrim,
|
StrTrim,
|
||||||
StrUpcase,
|
StrUpcase,
|
||||||
|
Format,
|
||||||
FormatDate,
|
FormatDate,
|
||||||
FormatDuration,
|
FormatDuration,
|
||||||
FormatFilesize,
|
FormatFilesize,
|
||||||
@ -232,6 +233,9 @@ pub fn add_shell_command_context(mut engine_state: EngineState) -> EngineState {
|
|||||||
Whoami,
|
Whoami,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
bind_command! { ULimit };
|
||||||
|
|
||||||
// Date
|
// Date
|
||||||
bind_command! {
|
bind_command! {
|
||||||
Date,
|
Date,
|
||||||
|
2
crates/nu-command/src/env/export_env.rs
vendored
2
crates/nu-command/src/env/export_env.rs
vendored
@ -19,7 +19,7 @@ impl Command for ExportEnv {
|
|||||||
.required(
|
.required(
|
||||||
"block",
|
"block",
|
||||||
SyntaxShape::Block,
|
SyntaxShape::Block,
|
||||||
"the block to run to set the environment",
|
"The block to run to set the environment.",
|
||||||
)
|
)
|
||||||
.category(Category::Env)
|
.category(Category::Env)
|
||||||
}
|
}
|
||||||
|
2
crates/nu-command/src/env/load_env.rs
vendored
2
crates/nu-command/src/env/load_env.rs
vendored
@ -27,7 +27,7 @@ impl Command for LoadEnv {
|
|||||||
.optional(
|
.optional(
|
||||||
"update",
|
"update",
|
||||||
SyntaxShape::Record(vec![]),
|
SyntaxShape::Record(vec![]),
|
||||||
"the record to use for updates",
|
"The record to use for updates.",
|
||||||
)
|
)
|
||||||
.category(Category::FileSystem)
|
.category(Category::FileSystem)
|
||||||
}
|
}
|
||||||
|
2
crates/nu-command/src/env/source_env.rs
vendored
2
crates/nu-command/src/env/source_env.rs
vendored
@ -24,7 +24,7 @@ impl Command for SourceEnv {
|
|||||||
.required(
|
.required(
|
||||||
"filename",
|
"filename",
|
||||||
SyntaxShape::String, // type is string to avoid automatically canonicalizing the path
|
SyntaxShape::String, // type is string to avoid automatically canonicalizing the path
|
||||||
"the filepath to the script file to source the environment from",
|
"The filepath to the script file to source the environment from.",
|
||||||
)
|
)
|
||||||
.category(Category::Core)
|
.category(Category::Core)
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user