Commit Graph

358 Commits

Author SHA1 Message Date
Jonathan Turner
ed80933806
String interpolation (#1849)
* Add string interpolation

* fix coloring

* A few more fixups + tests

* merge master again
2020-05-20 07:27:26 +12:00
Chris Pearce
ae87582cb6
Fix missing invocation errors (#1846) 2020-05-19 08:57:25 -04:00
Jonathan Turner
b89976daef
let format access variables also (#1842) 2020-05-19 16:20:09 +12:00
lightclient
3144dc7f93
add support for specifying max history size in config (#1829) (#1837) 2020-05-19 10:27:08 +12:00
Jason Gedge
6efabef8d3
Remove interpretation of Primitive::Nothing as the number 0. (#1836) 2020-05-18 15:18:46 -04:00
Jonathan Turner
0743b69ad5
Move from language-reporting to codespan (#1825) 2020-05-19 06:44:27 +12:00
Jason Gedge
5f1136dcb0
Fix newly added examples. (#1830) 2020-05-18 11:40:44 -04:00
Jason Gedge
acf13a6fcf
Add (near) automatic testing for command examples (#1777) 2020-05-18 08:56:01 -04:00
Sam
3fc4a9f142
added config check to disable auto pivoting of single row outputs (#1791)
* added config check to disable auto pivoting of single row outputs

* fixed change to use built-in boolean values
2020-05-18 20:42:22 +12:00
Shaurya Shubham
b6cdfb1b19
Remove the -n flag from shuffle (#1823) 2020-05-18 19:12:35 +12:00
Joseph T. Lyons
334685af23
Add some examples (#1821)
* Adds some examples

* Run rustfmt

* Fixed a few descriptions in the examples
2020-05-18 19:11:37 +12:00
Jonathan Turner
c475be2df8
Fix starship not getting the correct pwd (#1822) 2020-05-18 17:22:54 +12:00
Andrés N. Robalino
f18424a6f6 Remove test-bins feature. 2020-05-17 23:32:55 -05:00
John Erickson
d1b1438ce5
Check capture group count (#1814) 2020-05-17 14:52:17 -04:00
Joseph T. Lyons
af6aff8ca3
Allow user to specify the indentation setting on the pretty flag for the to json command (#1818)
* Allow user to specify the indentation setting on the pretty flag for the to json command

* Use "JSON" over "json"
2020-05-18 06:48:58 +12:00
Kurtis
d4dd8284a6
create Palette trait (#1813)
* create Pallet trait

* correct spelling to palette

* move palette to it's own module
2020-05-18 05:48:57 +12:00
Shaurya Shubham
41e1aef369
Fix the insert command (#1815) 2020-05-17 08:30:52 -04:00
Joseph T. Lyons
e50db1a4de
Adds support to pretty format the json in to json (#1812)
* Current work on the --pretty flag for to json

* Deleted notes that were pushed by accident

* Fixed some errors
2020-05-17 16:43:10 +12:00
Jonathan Turner
0abc94f0c6
Bump some of our dependencies (#1809) 2020-05-17 10:34:10 +12:00
Jonathan Turner
48d06f40b1
Remove the old it-hacks from fetch and post (#1807) 2020-05-17 06:18:46 +12:00
Jonathan Turner
f43ed23ed7
Fix parsing of invocations with a dot (#1804) 2020-05-16 19:25:18 +12:00
Joseph T. Lyons
40ec8c41a0
Cal command updates (#1758)
* Calculate the quarter directly

* Group some data together, remove attribute to ignore Clippy warning

* Group items into structs and add methods

* Updates to cal command

* Update cal.rs

* Update cal.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-05-16 16:00:06 +12:00
Jonathan Turner
076fde16dd
Evaluation of command arguments (#1801)
* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* WIP

* Finish adding the baseline refactors for argument invocation

* Finish cleanup and add test

* Add missing plugin references
2020-05-16 15:18:24 +12:00
Sam
822440d5ff
added nothing value for incalcuable dir sizes (#1789) 2020-05-15 12:53:18 -04:00
Andrés N. Robalino
fc8ee8e4b9
Extracted grouping by date to it's own subcommand. (#1792) 2020-05-15 04:16:09 -05:00
Xavier L'Heureux
5fbe5cf785
Use the directories crate instead of app_dirs (#1782)
The app_dirs crate is abandonned since quite a bit of time. Use the directories
crate instead, which is maintained and have more OS support.
2020-05-14 20:17:23 +12:00
Michael Nitschinger
e7f08cb21d
Allow external binary to register custom commands. (#1780)
This changeset contains everything that a separate binary needs to
register its own commands (including the new help function). It is
very possible that this commit misses other pub use exports, but
the contained ones work for our use cases so far.
2020-05-14 12:35:22 +12:00
Hoàng Đức Hiếu
e3b7e47515
cal: fix thursday typo (#1776) 2020-05-13 08:06:31 -04:00
Jonathan Turner
196991ae1e
Bump to 0.14.1 (#1772) 2020-05-13 20:03:45 +12:00
Joseph T. Lyons
9700b74407
Fix type in config flag description (#1769) 2020-05-13 14:21:57 +12:00
Bruno Heridet
803c6539eb
doc: fix nth examples (#1768) 2020-05-12 16:47:45 -04:00
Jason Gedge
75edcbc0d0
Simplify mv in FilesystemShell (#1587) 2020-05-12 16:40:45 -04:00
Jonathan Turner
b2eecfb110
Bump to 0.14 (#1766) 2020-05-13 04:32:51 +12:00
Jason Gedge
b0aa142542
Add examples for some more commands (#1765) 2020-05-13 03:54:29 +12:00
Bruno Heridet
247d8b00f8
doc: fix prepend example definition (#1761)
It seems that the description was copy-pasted by mistake from the
append command.
2020-05-12 19:46:21 +12:00
Jonathan Turner
0b520eeaf0
Add a batch of help examples (#1759) 2020-05-12 17:17:17 +12:00
Jonathan Turner
c3535b5c67
It-expansion fixes (#1757)
* It-expansion fixes

* fix clippy
2020-05-12 15:58:16 +12:00
Jonathan Turner
8b9a8daa1d
Add a batch of help examples (#1755) 2020-05-12 13:00:55 +12:00
Jonathan Turner
c5ea4a31bd
Adding coloring to help examples (#1754) 2020-05-12 11:06:40 +12:00
Jonathan Turner
2275575575
Improve list view and ranges (#1753) 2020-05-12 08:06:09 +12:00
Elichai Turkel
c3a066eeb4
Add examples to commands (#1752)
* Pass &dyn WholeStreamCommand to get_help

* Add an optional example to the WholeStreamCommand trait

* Add an example to the alias command
2020-05-12 08:05:44 +12:00
Jonathan Turner
42eb658c37
Add a simplified list view (#1749) 2020-05-11 14:47:27 +12:00
Jonathan Turner
a2e9bbd358
Improve duration math and printing (#1748)
* Improve duration math and printing

* Fix test
2020-05-11 13:44:49 +12:00
Joseph T. Lyons
f702aae72f
Don't include year and month by default, adds an option to display th… (#1745)
* Don't include year and month by default, adds an option to display the quarters of the year

* Add a test for cal that checks that year requested is in the return

* rustfmt the cal tests
2020-05-11 12:35:24 +12:00
Joseph T. Lyons
f5e03aaf1c
Add cal command (#1739)
* Add cal command

* Fix docmentation to show commands on two lines

* Use bullet points on flag documentation for cal

* Dereference day before calling string method

* Silence Clippy warning regarding a function with too many arguments

* Update cal flag descriptions and documentation

* Add some tests for the cal command
2020-05-10 11:05:48 +12:00
Jonathan Turner
0f0847e45b
Move 'start' to use ShellError (#1743)
* Move 'start' to use ShellError

* Remove unnecessary changes

* Add missing macOS change

* Add default

* More fixed

* More fixed
2020-05-10 08:08:53 +12:00
Elton Leander Pinto
ccd5d69fd1
Bug fix start (#1738)
* fix bug on linux; added start to the stable list

* add to stable and fix clippy lint
2020-05-10 05:28:57 +12:00
chrisr
55374ee54f
Fix help text for alias command. (#1742)
* Fix help text for alias command.

* Rust fmt
2020-05-09 12:16:14 -05:00
Andrés N. Robalino
f93ff9ec33
Make grouping more flexible. (#1741) 2020-05-09 12:15:47 -05:00
Elton Leander Pinto
9a94b3c656
start command in nushell (#1727)
* mvp for start command

* modified the signature of the start command

* parse filenames

* working model for macos is done

* refactored to read from pipes

* start command works well on macos; manual testing reveals need of --args flag support

* implemented start error; color printing of warning and errors

* ran clippy and fixed warnings

* fix a clippy lint that was caught in pipeline

* fix dead code clippy lint for windows

* add cfg annotation to import
2020-05-09 06:19:48 +12:00
Andrés N. Robalino
180c1204f3
Use playground instead of depending on fixture format files. (#1726) 2020-05-07 06:58:35 -05:00
Andrés N. Robalino
96e5fc05a3
Pick->Select rename. Integration tests changes. (#1725)
Pick->Select rename. Integration tests changes.
2020-05-07 06:03:43 -05:00
Andrés N. Robalino
c3efdf2689
Rename edit command to update. (#1724)
Rename edit command to update.
2020-05-07 00:33:30 -05:00
Jason Gedge
27fdef5479
Read exit status before failing in failed read from stdout pipe (#1723) 2020-05-07 13:42:01 +12:00
Jonathan Turner
7ce8026916
Ignore empty arguments passed to externals (#1722) 2020-05-07 09:18:56 +12:00
Jonathan Turner
8a9fc6a721
Fix changing to a new Windows drive (#1721)
* Fix changing to a new Windows drive

* Update cli.rs
2020-05-07 05:51:03 +12:00
Jonathan Turner
c06a692709
Bash-like shorthand with-env (#1718)
* Bash-like shorthand with-env

* fix clippy warning
2020-05-06 18:57:37 +12:00
Jonathan Turner
b37e420c7c
Add with-env command (#1717) 2020-05-06 15:56:31 +12:00
Jörn Zaefferer
3201c90647
Extend to/from usage text to indicate subcommands (#1711)
Both to and from without a subcommand only print the helptext. Expand the usage line a bit, so a glance at `help commands` indicates the existance of the subcommands and mentions some common formats.

Ref a9968046ed
Ref #1708
2020-05-05 09:00:29 +12:00
Jonathan Turner
454f560eaa
Properly deserialize history args (#1710) 2020-05-05 07:50:10 +12:00
Darren Schroeder
d2ac506de3
Changes to allow plugins to be loaded in a multi-threaded manner (#1694)
* Changes to allow plugins to be loaded in a multi-threaded manner in order to decrease startup time.

* Ran rust fmt and clippy to find and fix first pass errors.
Updated launch.jason to make debugging easier in vscode.
Also added tasks.json so tasks like clippy can be ran easily.

* ran fmt again

* Delete launch.json

Remove IDE settings file

* Remove IDE settings file

* Ignore vscode IDE settings

* Cloned the context instead of Arc/Mutexing it.

Co-authored-by: Darren Schroeder <fdncred@hotmail.com>
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-05-05 06:15:24 +12:00
Jonathan Turner
a9968046ed
Add subcommands. Switch from-* and to-* to them (#1708) 2020-05-04 20:44:33 +12:00
Jonathan Turner
453087248a
Properly drain iterating pipe so we can see errors (#1707) 2020-05-04 15:29:32 +12:00
Joseph T. Lyons
81ff598d6c
Fix column bugs associated with previous refactoring (#1705)
* Fix: the symlink target column will only dispaly if either the `full` or `with_symlink_targets` options are given

* If the metadata for every item in the size column is None, do not show the size column

* Do not show the symlink target column if the metadata is None for all the items in the table
2020-05-04 14:58:11 +12:00
Joseph T. Lyons
8d69c77989
Display either dir metadata size or dir apparent size in ls (#1696)
* Show dir size in ls command

* Add the option to show the apparent directory size via `ls --du`
2020-05-03 17:09:17 +12:00
chrisr
ada92f41b4
Parse file size (byte) units in all mixes of case (#1693) 2020-05-02 14:14:07 -04:00
Joseph T. Lyons
ef3049f5a1
Reduce some repetitive code in files.rs (#1692) 2020-05-02 11:14:29 -04:00
Darren Schroeder
e9e3fac59d
Remove bin.is_file() because it's expensive (#1689)
This one change takes the startup time from 2.8 seconds to 1.2 seconds in my testing on Windows.
2020-05-01 06:43:59 +12:00
Jonathan Turner
7d403a6cc7
Escape some symbols in external args (#1687)
* Escape some symbols in external args

* Don't escape on Windows, which does its own

* fix warning
2020-04-30 16:54:07 +12:00
Andrés N. Robalino
cf53264438
Table operating commands. (#1686)
* Table operating commands.

* Updated merge test for clarity.

* More clarity.

* Better like this..
2020-04-29 23:18:24 -05:00
Jonathan Turner
d834708be8
Finish remove the last traces of per-item (#1685) 2020-04-30 14:23:40 +12:00
Mohammed Anas
789b28ac8a
Convert if expression to match (#1683) 2020-04-30 12:59:50 +12:00
Jonathan Turner
db8219e798
extend it-expansion to externals (#1682)
* extend it-expansion to externals

* trim the carriage return for external strings
2020-04-30 07:09:14 +12:00
Jonathan Turner
73d5310c9c
make it-expansion work through blocks when necessary (#1681) 2020-04-29 19:51:46 +12:00
Joseph T. Lyons
8d197e1b2f
Show symlink sizes in ls (#1680)
* Show symlink sizes in ls

* Reduce redundancy in the size code of ls
2020-04-29 19:23:26 +12:00
Kevin Del Castillo
c704157bc8
Replace ichwh with which and some fixes for auto-cd (canonicalization) (#1672)
* fix: absolutize path against its parent if it was a symlink.

On Linux this happens because Rust calls readlink but doesn't canonicalize the resultant path.

* feat: playground function to create symlinks

* fix: use playground dirs

* feat: test for #1631, shift tests names

* Creation of FilesystemShell with custom location may fail

* Replace ichwh with which

* Creation of FilesystemShell with custom location may fail

* Replace ichwh with which

* fix: add ichwh again since it cannot be completely replaced

* fix: replace one more use of which
2020-04-28 05:49:53 +12:00
Jonathan Turner
6abb9181d5
bump to 0.13.1 (#1670) 2020-04-27 18:50:14 +12:00
Jonathan Turner
006171d669
Fix per-item run_alias (#1669)
* Fix per-item run_alias

* Fix 1609 also
2020-04-27 18:10:34 +12:00
Jonathan Turner
8bd3cedce1
It expansion (#1668)
* First step in it-expansion

* Fix tests

* fix clippy warnings
2020-04-27 14:04:54 +12:00
Jason Gedge
6f2ef05195
Resolves https://github.com/nushell/nushell/issues/1658 (#1660)
For example, when running the following:

    crates/nu-cli/src

nushell currently parses this as an external command. Before running the command, we check to see if
it's a directory. If it is, we "auto cd" into that directory, otherwise we go through normal
external processing.

If we put a trailing slash on it though, shells typically interpret that as "user is explicitly
referencing directory". So

    crates/nu-cli/src/

should not be interpreted as "run an external command". We intercept a trailing slash in the head
position of a command in a pipeline as such, and inject a `cd` internal command.
2020-04-27 13:22:01 +12:00
Andrés N. Robalino
80025ea684
Rows and values can be checked for emptiness. Allows to set a value if desired. (#1665) 2020-04-26 12:30:52 -05:00
rimathia
a62745eefb
make trim apply to strings contained in tables (also at deeper nesting (#1664)
* make trim apply to strings contained in tables (also at deeper nesting
levels), not just top-level strings

* remove unnecessary clone (thanks clippy)
2020-04-27 05:26:02 +12:00
Jonathan Turner
2ac501f88e
Adds drop number of rows command (#1663)
* Fix access to columns with quoted names

* Add a drop number of rows from end of table
2020-04-26 18:34:45 +12:00
Jonathan Turner
df90d9e4b6
Fix access to columns with quoted names (#1662) 2020-04-26 18:01:55 +12:00
Jonathan Turner
ad7a3fd908
Add not-in: operator (#1661) 2020-04-26 17:32:17 +12:00
Adam Shirey
ad8ab5b04d
Add from-eml command (#1656)
* from-eml initial ver

* Adding tests for `from-eml`

* Add eml to prepares_and_decorates_filesystem_source_files

* Sort the file order

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-04-26 16:26:35 +12:00
rimathia
e7767ab7b3
suppress the parser error for an insufficient number of required arguments if the named keyword argument 'help' is given (#1659) 2020-04-26 04:45:45 +12:00
Kevin Del Castillo
846a779516
Fix cd'ing to symlinked directories (#1651)
* fix: absolutize path against its parent if it was a symlink.

On Linux this happens because Rust calls readlink but doesn't canonicalize the resultant path.

* feat: playground function to create symlinks

* fix: use playground dirs

* feat: test for #1631, shift tests names
2020-04-25 18:09:00 +12:00
Andrés N. Robalino
10768b6ecf
str plugin can capitalize and trim strings. (#1652)
* Str plugin can capitalize.

* Str plugin can trim.
2020-04-24 16:37:58 -05:00
Thomas B Homburg
716c4def03
Add key_timeout config option (#1649) 2020-04-25 05:28:38 +12:00
Andrés N. Robalino
0e510ad42b
Values can be used as keys for grouping. (#1648) 2020-04-23 20:55:18 -05:00
Jonathan Turner
d7bd77829f
Bump rustyline (#1644)
* Bump rustyline

* Fix new clippy warnings

* Add pipeline command
2020-04-24 08:00:49 +12:00
Jonathan Turner
701711eada
Be more resilient with startup lines (#1642) 2020-04-23 17:22:01 +12:00
Kevin Del Castillo
9ec2aca86f
Support completion for paths with multiple dots (#1640)
* refactor: expand_path and expand_ndots now work for any string.

* refactor: refactor test and add new ones.

* refactor: convert expanded to owned string

* feat: pub export of expand_ndots

* feat: add completion for ndots in fs-shell
2020-04-23 16:17:38 +12:00
Pirmin Kalberer
818171cc2c
Make default completion mode OS dependent (#1636) 2020-04-23 10:53:40 +12:00
Lars Mühmel
b3c623396f
Fix to-csv command (#1635)
* Fix --headerless option of to-csv and to-tsv

Before to-csv --headerless split the "headerfull" output on lines,
skipped the first, and then concatenated them together. That meant
that all remaining output would be put on the same line, without
any delimiter, making it unusable. Now we replace the range of the
first line with the empty string, maintaining the rest of the
output unchanged.

* Remove extra space in indentation of to_delimited_data

* Add --separator <string> argument to to-csv

This functionaliy has been present before, but wasn't exposed
to the command.
2020-04-23 05:08:53 +12:00
Jonathan Turner
88f06c81b2
Update Cargo.toml 2020-04-22 06:34:32 +12:00
Alex van de Sandt
e6b315f05b
Bump ichwh to version 0.3.4 (#1627)
Fixes #1626 and [this ichwh issue](https://gitlab.com/avandesa/ichwh-rs/-/issues/3)
2020-04-22 05:37:14 +12:00
Cristian
01ef6b0732
Add config to disable table index column (#1623) 2020-04-21 18:09:22 +12:00
Jonathan Turner
c7e11a5a28
bump to 0.13.0 (#1625) 2020-04-21 17:01:03 +12:00