nushell/crates/nu-command/tests/commands
Jakub Žádník 3b2ed7631f
Path Enhancement Project #2: parse, join and split (#3256)
* Add new path parse subcommand

This includes a slight refactor to all the path subcommand `action()`
functions.

* Remove filestem and extension; Fix example

* Add additional description to path parse

* Put join arg behind flag; Fix missing import (Win)

* Fix error when column path is passed as arg

* Add structured path joining

Structured path is implicitly joined at every patch subcommand call.

* Fix existing path join tests; Fix rustfmt

* Remove redundant 'static lifetime (clippy)

* Add initial impl of path split subcommand

* Add ability to join path from parts

* Fix wrong results in path split examples

* Fix remaining asyncs after engine change

* Do not wrap split path parts into table

When the input is just a list of values, the `path split` command will
split each value directly into the output stream, similar to
`split-row`. Column path--specified values are still wrapped into a
table so they can still be used to replace table fields.

* Join list of values instead of going one-by-one

When `path join` encounters a list of values, it attempts to join them,
instead of going one-by-one like the rest of the path commands. You can
still `each { echo $it | path join }` to join them one-by-one, if the
values are, e.g., tables.

Now, the behavior of `path split` and `path join` should match the
`split-row` and `str collect` counterparts and should hopefully align
better with user's expectations.

* Make sure path join detects structured path

* Fix panic on empty input stream

Also, doesn't collect input into vector unnecessarily.

* Fix path join not appending value

* Remove argument serialization

* Make better errors; Misc refactor

* OsStr -> String encoding is now lossy, instead of throwing an error
* The consequence is action() now always returns Value instead of Result
* Removed redundant handle_value() call in `path join`
* Fix possible incorrect error detection in `path split`
* Applied rustfmt + clippy

* Add more usage, examples & test; Fix type error

The 'parent' column was required to be a path but didn't work with
string.

* Add more help & examples; Maybe fix Windows error

* Refactor operate function

Reducing code repetition

* Review usages and examples

* Add the option to manually specify the extension

* Add more tests; Fix failures on Windows

* Move path commands to engine-p

* Small refactor
2021-04-20 18:45:28 +12:00
..
hash_ Add basic support for md5 hashing strings and binary data (#3197) 2021-03-21 07:48:53 +13:00
keep nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
math Remove yr and mon (#3262) 2021-04-05 06:19:33 +12:00
move_ nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
path Path Enhancement Project #2: parse, join and split (#3256) 2021-04-20 18:45:28 +12:00
random Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
skip nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
str_ allow str from to convert more things to string (#2977) 2021-01-29 07:43:35 -06:00
all.rs commands: any? all? (#3252) 2021-04-03 13:40:54 -05:00
any.rs commands: any? all? (#3252) 2021-04-03 13:40:54 -05:00
append.rs Playground infraestructure (tests, etc) additions. (#3179) 2021-03-15 02:26:30 -05:00
cal.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
cd.rs Replace dirs and directories with maintained (#2949) 2021-01-19 14:24:27 -06:00
compact.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
config.rs Refactor/config commands (#3265) 2021-04-09 18:03:12 +12:00
cp.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
def.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
default.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
drop.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
each.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
echo.rs RangeIterator can also go down (#2913) 2021-01-13 08:27:54 +13:00
empty.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
enter.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
every.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
first.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
flatten.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
format.rs standardize on how to get file size (#2992) 2021-02-03 07:19:38 -06:00
get.rs Fix warnings for Rust 1.51 (#3214) 2021-03-26 21:26:57 +13:00
group_by.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
headers.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
help.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
histogram.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
insert.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
into_int.rs add "into int" behavior (#3279) 2021-04-09 09:17:39 -05:00
last.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
length.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
lines.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
ls.rs Output error when ls into a file without permission (#3218) 2021-03-31 19:52:39 +13:00
merge.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
mkdir.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
mod.rs Refactor/config commands (#3265) 2021-04-09 18:03:12 +12:00
nth.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
open.rs imp: bump rustyline to 8.0.0 (#3167) 2021-03-14 15:13:31 +13:00
parse.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
prepend.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
range.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
reduce.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
rename.rs Fix warnings for Rust 1.51 (#3214) 2021-03-26 21:26:57 +13:00
reverse.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
rm.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
roll.rs Table content rolling. (#3097) 2021-02-23 13:29:07 -05:00
rotate.rs 90 degree table rotations (clockwise and counter-clockwise) (#3086) 2021-02-22 06:56:34 -05:00
save.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
select.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
semicolon.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
sort_by.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
split_by.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
split_column.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
split_row.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
touch.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
uniq.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
update.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
where_.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
which.rs Rename count to length (#3166) 2021-03-14 10:46:40 +13:00
with_env.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00
wrap.rs nu-cli refactor moving commands into their own crate nu-command (#2910) 2021-01-12 17:59:53 +13:00