Commit Graph

348 Commits

Author SHA1 Message Date
Chris Gillespie
365f76ad19
Tidy up help command text (#2566) 2020-09-18 18:13:53 +12:00
Radek Vít
1dc8f3300e
Make the sleep command pass data through. (#2558) 2020-09-16 19:34:37 -04:00
Andrés N. Robalino
10d4edc7af
Slim down configuration readings and nu_cli clean up. (#2559)
We continue refactoring nu_cli and slim down a bit configuration
readings with a naive metadata `modified` field check.
2020-09-16 18:22:58 -05:00
Chris Gillespie
50cbf91bc5
Remove trim in favor of str trim (#2560) 2020-09-16 15:59:32 -04:00
Radek Vít
d05f9b3b1e
Make the sleep command respond to Ctrl+C (#2550) 2020-09-16 12:14:33 -04:00
Darren Schroeder
d19a5f4c2f
add a few more ansi escape sequences (#2553) 2020-09-15 16:01:57 -05:00
Andrés N. Robalino
0178b53289
Core nu plugin load capability. (#2544)
We introduce the `plugin` nu sub command (`nu plugin`) with basic plugin
loading support. We can choose to load plugins from a directory. Originally
introduced to make integration tests faster (by not loading any plugins on startup at all)
but `nu plugin --load some_path ; test_pipeline_that_uses_plugins_just_loaded` does not see it.

Therefore, a `nu_with_plugins!` macro for tests was introduced on top of nu`s `--skip-plugins`
switch executable which is set to true when running the integration tests that use the `nu!` macro now..
2020-09-14 09:07:02 -05:00
Chris Gillespie
e05e6b42fe
Simplify a few boolean creations (#2543) 2020-09-14 13:15:44 +12:00
Chris Gillespie
c355585112
Set active shell column to boolean (#2540) 2020-09-13 16:25:38 +12:00
gorogoroumaru
45f32c9541
Allow math avg to work on durations (#2529)
* Allow `math avg` to work on durations

* formatting

* fix linting issue and implemented `math sum` for duration

* fix linting issue

* applied requested changes

* applied requested change for avg.rs

* formatting
2020-09-12 18:56:05 -05:00
Andrés N. Robalino
7528094e12
Allow folding with tables. (#2538) 2020-09-12 01:40:52 -05:00
Yusuke Ito
dcfa135ab9
support key-value argument in with-env(#2490) (#2530)
* support key-value argument in with-env

* remove unused import

* fix format for lint
2020-09-11 18:17:35 +12:00
Yusuke Ito
e9bb4f25eb
accept multiple variables in with-env(#2490) (#2526)
* accept multiple variables in with-env(#2490)

* add examples for test

* fix format(#2490)
2020-09-10 19:23:28 +12:00
Jonathan Turner
d9ae66791a
allow decimals as a range boundary (#2509) 2020-09-08 05:30:11 +12:00
Ritoban Roy-Chowdhury
2c5939dc7d
each group and each window subcommands. (#2508)
* First commit updating `config` to use subcommands (#2119)
    - Implemented `get` subcommand

* Implmented `config set` as a subcommand.

* Implemented `config set_into` as subcommand

* Fixed base `config` command
 - Instead of outputting help, it now outputs the list of all
 configuration parameters.

* Added `config clear` subcommand

* Added `config load` and `config remove` subcommands

* Added `config path` subcommand

* fixed clippy

* initial commit for implementing groups

* each group works

* each group is slightly cleaner + added example

* Added `each window` subcommand
    - No support for stride flag yet

* each window stride implemented

* Added tests and minor documentation changes

* fixed clippy

* fixed clippy again
2020-09-07 17:54:52 +12:00
Jonathan Turner
c9ffd6afc0
Improve range parsing and handling (#2506)
* Improve range parsing and handling

* linting
2020-09-07 14:43:58 +12:00
Abhi V
79cc725aff
Interpreting ranges for substring (#2499) 2020-09-06 12:35:11 -04:00
Darren Schroeder
e2cbc4e853
Weather symbol cleanup (#2502)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* merges

* clean up some comments
2020-09-05 14:52:49 -05:00
Darren Schroeder
bdb12f4bff
Weather chars (#2500)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* merges

* added weather symbols/chars
2020-09-05 13:13:07 -05:00
Aleš Katona
32951f1161
implement exec for unix platforms (#2495) 2020-09-04 22:27:01 -04:00
smaydew
1ffbb66e64
Initial implementation of random integer subcommand. (#2489)
* Initial implementation of random integer subcommand.

* Added additional examples.

Co-authored-by: Stacy Maydew <stacy.maydew@starlab.io>
2020-09-04 07:23:02 +12:00
Chris Gillespie
666e6a7b57
Size: count unicode graphmemes as single char (#2482) 2020-09-03 04:54:00 +12:00
Darren Schroeder
57a26bbd42
Default alignment (#2481)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* merges

* fixed bug where no config.toml or not set settings made weird defaults.

* clippy & fmt again

* Header default alignment is left.

Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-09-01 19:08:41 -05:00
Darren Schroeder
adbbcafd30
Add minor theme support (#2449)
* WIP - compiling but not working

* semi-working

* making progress

* working except for table lines

* fmt + clippy

* cleaned up some comments

* working line colors

* fmt, clippy, updated sample config.toml

* removed extra comments
2020-09-01 17:09:55 +12:00
Chris Gillespie
6b5d96337e
Add examples to uniq (#2472) 2020-09-01 14:52:55 +12:00
Chris Gillespie
f54cf8a096
Size command: rename max length to bytes (#2473)
Since max length is just getting the byte length, rename to bytes
in order to be more clear.
2020-09-01 14:51:35 +12:00
Darren Schroeder
3f443f40d0
with_love table theme (#2468) 2020-08-31 11:50:32 -05:00
Darren Schroeder
8192360b20
added compact_double table theme for funsies (#2467) 2020-08-31 09:49:27 -05:00
Jonathan Turner
8d1cecf643
Set auto-pivot to never by default (#2462) 2020-08-31 14:38:08 +12:00
Chris Gillespie
965e07d8cc
Minor updates to variance (#2458) 2020-08-30 16:50:36 -04:00
Chris Gillespie
84a6010f71
Minor stddev updates (#2452)
1. Add an example for getting the sample stddev
2. Opt for ? instead of generic Err match
2020-08-30 15:36:43 +12:00
Dillen Meijboom
11ea5e61fc
Fix out of bounds in header command when row size is different (#2437)
* Use header vec to loop over the row instead of the row itself to fix out of bounds

* Fixed formatting
2020-08-29 06:32:08 +12:00
Andrés N. Robalino
26cec83b63 Extract out history parts. 2020-08-27 06:28:18 -05:00
Andrés N. Robalino
4724b3c570 Slim down cli plugin logic. 2020-08-27 06:28:18 -05:00
Gurpreet Singh
303a9defd3
Added math product support (#2249)
* added math product: working initial impl

* resolving merge conflicts

* impl std::ops::Mul for Filesize

* rebased with main; refactored product implementation

* fixed error msg, added docs for math product
2020-08-27 17:58:01 +12:00
Bailey Layzer
a64270829e
Move alias type inference (experimental) behind --infer/-i flag (#2418)
* put alias type inference behind --infer/-i flag

* revert cargo.lock
2020-08-27 17:48:13 +12:00
Darren Schroeder
8f5df89a78
added -e --end to search from the end of the string for the pattern (#2430)
* added -e --end to search from the end of the string for the pattern

* tests
2020-08-27 17:46:45 +12:00
utam0k
7702d683c7
Allow the calculation of bytes and int. (#2160)
* Allow the calculation of bytes and int.

* fix clippy.

* minimal implement the into_into command.

* Revert "fix clippy."

This reverts commit 0d7cf72ed2.

* Revert "Allow the calculation of bytes and int."

This reverts commit 9c4e3787f5.

* set the argument to any type.

* if the argument is an int, return it with no change in value.

* add tests for into-int command.

* fix a faild test.
2020-08-27 17:44:18 +12:00
Darren Schroeder
766533aafb
Path dirname and filestem (#2428)
* add dirname and filestem to path commands

* hacked around with gedge's help to get it to compile with cargo b

* fmt
2020-08-26 14:47:23 -05:00
Darren Schroeder
6e3a827e32
plugin changes to support script plugins (#2315)
* plugin changes to support script plugins
* all platforms can have plugins with file extensions
* added .cmd, .py, .ps1 for windows
* added more trace! statements to document request and response

* WIP

* pretty much working, need to figure out sink plugins

* added a home for scripting plugin examples, ran fmt

* Had a visit with my good friend Clippy. We're on speaking terms again.

* add viable plugin extensions

* clippy

* update to load plugins without extension in *nix/mac.

* fmt
2020-08-26 13:45:11 -05:00
Andrés N. Robalino
6685f74e03 Command especific configuration extraction baseline. 2020-08-26 10:33:55 -05:00
Andrés N. Robalino
034c33c2b5 Allow invocations and fix span error reporting. 2020-08-26 06:46:14 -05:00
Jörn Zaefferer
08d1be79fc
Add some cross-references to usage texts (#2417) 2020-08-26 09:43:41 +12:00
Jonathan Turner
f078aacc25
Improve the error message if alias type inference fails (#2399)
* Improve the error message if alias type inference fails

* Improve error further
2020-08-25 06:38:24 +12:00
Jonathan Turner
48850becd8
Add some minor fixes (#2391) 2020-08-22 17:06:19 +12:00
gorogoroumaru
2ea42f296c
Date subcommands (#2383)
* refactored date command

* format files
2020-08-22 15:46:48 +12:00
Shaurya
a951edd0d5
Fix the version command to include the commit hash (#2390)
* Fix the version command to include the commit hash when it is _not_ empty

* Format code
2020-08-22 15:21:59 +12:00
Jörn Zaefferer
ee26590011
touch: support multiple arguments (#2386)
Fixes #2384
2020-08-22 12:08:30 +12:00
Leonhard Kipp
0dd1403a69
Sleep command (#2381)
* Add deserialization of Primitive::Duration; Fixes #2373

* Implement Sleep command

* Add comment saying you should name your rest field "rest"

* Fix typo

* Add documentation for sleep command
2020-08-22 05:51:29 +12:00
Bailey Layzer
ad395944ef
SyntaxShape checking in Alias (#2377)
* initial, working for shallow internals

* add recurion on Block

* clean up/abstract, Invocations

* use Result

* inspection of Binary, tests

* improve code structure

* move arg shape inspection to Alias command

* add spanned errors, tests, cleanup for PR

* fix test, clippy
2020-08-20 15:18:55 +12:00