Commit Graph

2008 Commits

Author SHA1 Message Date
Jonathan Turner
473e9f9422
Tiny improvement to sys (#1385) 2020-02-13 08:33:55 -08:00
Corvus Corax
96985aa692
Fix invalid shorthand flag (#1384) 2020-02-13 07:47:34 -08:00
Corvus Corax
0961da406d
Add string to datetime to str plugin (#1381)
* Add string to datetime to str plugin

* Test string to date/time conversion
2020-02-13 07:47:04 -08:00
Andrés N. Robalino
84927d52b5
Refuse internal command execution given unexpected arguments. (#1383) 2020-02-13 02:34:43 -05:00
Andrés N. Robalino
73312b506f
Finer grained parsing and coloring command tail. (#1382) 2020-02-12 20:20:19 -05:00
Shaurya Shubham
c1bec3b443
Return error on a divide by zero (#1376)
Return error on a divide by zero
2020-02-12 08:38:04 -05:00
Corvus Corax
c0be02a434
Short-hand flags (#1378)
* typo fixes

* Change signature to take in short-hand flags

* update help information

* Parse short-hand flags as their long counterparts

* lints

* Modified a couple tests to use shorthand flags
2020-02-11 18:24:31 -08:00
Andrés N. Robalino
2ab8d035e6
External it and nu variable column path fetch support. (#1379) 2020-02-11 18:25:56 -05:00
Andrés N. Robalino
24094acee9
Allow switch flags anywhere in the pipeline. (#1375) 2020-02-11 03:49:00 -05:00
Jonathan Turner
0b2be52bb5
Only add quotes if not in Windows (which adds its own?) (#1374)
* Only add quotes if not in Windows (which adds its own?)

* Only add quotes if not in Windows (which adds its own?)
2020-02-10 23:07:44 -08:00
Corvus Corax
6a371802b4
Add block size to du (#1341)
* Add block size to du

* Change blocks to physical size

* Use path instead of strings for file/directory names

* Why don't I just use paths instead of strings anyway?

* shorten physical size and apparent size to physical and apparent resp.
2020-02-10 12:32:18 -08:00
Andrés N. Robalino
29ccb9f5cd
Ensure stable plugins get installed. (#1373) 2020-02-10 15:32:10 -05:00
Jonathan Turner
20ab125861
bump version (#1370) 2020-02-10 09:18:00 -08:00
Jonathan Turner
fb532f3f4e
Prototype shebang support (#1368)
* Add shebang support to nu.

* Move test file

* Add test for scripts

Co-authored-by: Jason Gedge <jason.gedge@shopify.com>
2020-02-10 08:49:45 -08:00
Jason Gedge
a29d52158e
Do not panic when failing to decode lines from external stdout (#1364) 2020-02-10 07:37:48 -08:00
Jonathan Turner
dc50e61f26 Switch stdin redirect to manual. Add test (#1367) 2020-02-09 22:55:07 -08:00
Ryan Blecher
a2668e3327
Add some nu_source docs for meta.rs (#1366)
* Add some docs for meta.rs

* add better explanation for Span merging

* Add some doc tests - not sure how to get them to run

* get rid of doc comments for the temporary method

* add doc test for is_unknown

* fmt
2020-02-09 18:08:14 -08:00
Jonathan Turner
e606407d79
Add error codes to -c (#1361) 2020-02-08 20:04:53 -08:00
Jonathan Turner
5f4fae5b06 Pipeline sink refactor (#1359)
* Refactor pipeline ahead of block changes. Add '-c' commandline option

* Update pipelining an error value

* Fmt

* Clippy

* Add stdin redirect for -c flag

* Add stdin redirect for -c flag
2020-02-08 18:24:33 -08:00
Jason Gedge
3687603799
Only spawn external once when no $it argument (#1358) 2020-02-08 17:57:05 -08:00
George Tsomlektsis
643b532537
Fixed mv not throwing error when the source path was invalid (#1351)
* Fixed mv not throwing error when the source path was invalid

* Fixed failing test

* Fixed another lint error

* Fix $PATH conflicts in .gitpod.Dockerfile (#1349)

- Use the correct user for gitpod Dockerfile.
- Remove unneeded packages (curl, rustc) from gitpod Dockerfile.

* Added test to check for the error

* Fixed linting error

* Fixed mv not moving files on Windows. (#1342)

Move files correctly in windows.

* Fixed mv not throwing error when the source path was invalid

* Fixed failing test

* Fixed another lint error

* Added test to check for the error

* Fixed linting error

* Changed error message

* Typo and fixed test

Co-authored-by: Sean Hellum <seanhellum45@gmail.com>
2020-02-07 12:40:48 -05:00
George Tsomlektsis
ed86b1fbe8
Fixed mv not moving files on Windows. (#1342)
Move files correctly in windows.
2020-02-07 11:24:01 -05:00
Sean Hellum
44a114111e
Fix $PATH conflicts in .gitpod.Dockerfile (#1349)
- Use the correct user for gitpod Dockerfile.
- Remove unneeded packages (curl, rustc) from gitpod Dockerfile.
2020-02-06 15:20:18 -05:00
Jonathan Turner
812a76d588
Update more futures-preview to futures (#1346) 2020-02-05 20:28:42 -08:00
Alex van de Sandt
e3be849c2a
Futures v0.3 upgrade (#1344)
* Upgrade futures, async-stream, and futures_codec

These were the last three dependencies on futures-preview. `nu` itself
is now fully dependent on `futures@0.3`, as opposed to `futures-preview`
alpha.

Because the update to `futures` from `0.3.0-alpha.19` to `0.3.0` removed
the `Stream` implementation of `VecDeque` ([changelog][changelog]), most
commands that convert a `VecDeque` to an `OutputStream` broke and had to
be fixed.

The current solution is to now convert `VecDeque`s to a `Stream` via
`futures::stream::iter`. However, it may be useful for `futures` to
create an `IntoStream` trait, implemented on the `std::collections` (or
really any `IntoIterator`). If something like this happends, it may be
worthwhile to update the trait implementations on `OutputStream` and
refactor these commands again.

While upgrading `futures_codec`, we remove a custom implementation of
`LinesCodec`, as one has been added to the library. There's also a small
refactor to make the stream output more idiomatic.

[changelog]: https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md#030---2019-11-5

* Upgrade sys & ps plugin dependencies

They were previously dependent on `futures-preview`, and `nu_plugin_ps`
was dependent on an old version of `futures-timer`.

* Remove dependency on futures-timer from nu

* Update Cargo.lock

* Fix formatting

* Revert fmt regressions

CI is still on 1.40.0, but the latest rustfmt v1.41.0 has changes to the
`val @ pattern` syntax, causing the linting job to fail.

* Fix clippy warnings
2020-02-05 19:46:48 -08:00
Jonathan Turner
ba1b67c072
Attempt rustup update on each PR (#1345)
* Attempt update on each PR

* Update fmt
2020-02-05 19:28:49 -08:00
Jason Gedge
fa910b95b7
Have from-ssv not fail for header-only inputs (#1334) 2020-02-05 11:54:14 -08:00
Ishan Bhanuka
427bde83f7
Allow cp to overwrite existing files (#1339) 2020-02-05 01:54:05 -05:00
Andrés N. Robalino
7a0bc6bc46
Opt-out unused heim features from sys/ps plugins. (#1335) 2020-02-04 01:51:14 -05:00
Ryan Blecher
c6da56949c
Add support for plugin names containing numbers (#1321)
* Add ability to have numbers in plugin name. Plugin must start with alphabetic char

* remove the first character as alphabetic requirement

* Update cli.rs

Going ahead and changing to plus to prevent issue notryanb found

* Update cli.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-02-01 22:08:38 -08:00
Alex
5b398d2ed2
Adding cross-platform kill command (#1326)
* Adding kill command, unclean code

* Removing old comments

* Added quiet option, supports variable number of ids

* Made it per_item_command, calling commands directly without the shell
2020-02-01 10:46:28 -08:00
Jason Gedge
dcdfa2a866
Improve tests and labeling in FilesystemShell (#1305)
Additional `ls` command tests and better FilesystemShell error and label messages.
2020-02-01 03:34:34 -05:00
Corvus Corax
9474fa1ea5
Improved code in du command (#1320)
Made the code a little easier to read
2020-02-01 03:32:06 -05:00
Shaurya Shubham
49a1385543
Make tests work from directory names with spaces (#1325) 2020-01-31 22:12:56 -08:00
Alex van de Sandt
6427ea2331
Update Cargo.lock for ichwh fix (#1312)
`ichwh@0.3.1` fixes a bug that causes path searches to fail. We update
`Cargo.lock` to fix this.

Resolves #1207
2020-01-31 22:11:42 -08:00
Andrés N. Robalino
3610baa227
Default plugins are independent and called from Nu. (#1322) 2020-01-31 17:45:33 -05:00
Andrés N. Robalino
4e201d20ca
Paths from Nu config take priority over external paths. (#1319) 2020-01-31 14:19:47 -05:00
Sebastian Thiel
1fa21ff056
Exclude images to reduce crate by 3MB (#1316)
Maybe there are more candidates for exclusion, but 'images/'
seemed obviously unnecessary.

Something I started realizing lately is that cargo puts most
of the root directory into the crate archive, causing huge
crates to appear on crates.io.

Now that I am in China, I do seem to notice every kilobyte.
2020-01-31 10:38:26 -05:00
Jonathan Turner
0bbd12e37f
Improve the default help message (#1313) 2020-01-30 20:13:14 -08:00
Shaurya Shubham
7df8fdfb28
Rename the now-deprecated add command docs into insert comm… (#1307) 2020-01-30 08:15:20 -05:00
Shaurya Shubham
6a39cd8546
Add docs for the calc command (#1290) 2020-01-29 08:34:54 -05:00
Shaurya Shubham
dc3370b103
Make a calc command (#1280) 2020-01-29 08:34:36 -05:00
Andrés N. Robalino
ac5ad45783
Pretty Nu print default, pretty print regular secondary as raw flag. (#1302) 2020-01-29 02:46:54 -05:00
chrisr
8ef5c47515
Update cargo flags (#1295)
* Update cargo flags

See https://github.com/nushell/nushell.github.io/issues/29

* Update to suggested flag
2020-01-28 22:44:49 -08:00
Andrés N. Robalino
5b19bebe7d
Isolate environment state changes into Host. (#1296)
Moves the state changes for setting and removing environment variables
into the context's host as opposed to calling `std::env::*` directly
from anywhere else.

Introduced FakeHost to prevent environemnt state changes leaking
between unit tests and cause random test failures.
2020-01-29 00:40:06 -05:00
Joseph T. Lyons
2c529cd849
Fix bug where --with-symlink-targets would not display the targets column (#1300) 2020-01-28 21:36:20 -08:00
Jonathan Turner
407f36af29
Remove unused dep (#1298) 2020-01-29 16:44:03 +13:00
Jonathan Turner
763fcbc137
Bump to 0.9.0 (#1297) 2020-01-29 15:17:02 +13:00
Corvus Corax
7061af712e ls will return error if no files/folders match path/pattern (#1286)
* `ls` will return error if no files/folders match path/pattern

* Revert changes to src/data/files.rs

* Add a name_only flag to dir_entry_dict

Add name_only flag to indicate if the caller only cares about filenames
or wants the whole path

* Update ls changes from feedback

* Little cleanup

* Resolve merge conflicts

* lints
2020-01-29 05:58:31 +13:00
Andrés N. Robalino
9b4ba09c95
Nu env vars from config have higher priority. (#1294) 2020-01-28 02:10:15 -05:00