Commit Graph

166 Commits

Author SHA1 Message Date
est31
9891e5ab81 Use async-stream crate to replace most async_stream_block invocations 2019-09-26 02:39:20 +02:00
Jonathan Turner
8ce73d838e
Bump heim
This bumps the heim dependency to fix an issue with sysinfo
2019-09-25 04:39:18 +12:00
Jonathan Turner
2de7792939 Bump version to 0.3.0 for release 2019-09-24 19:29:23 +12:00
Pirmin Kalberer
1e3549571c Bind fuzzy history search to Ctrl-R 2019-09-19 20:18:39 +02:00
Jonathan Turner
5ff94004c6 Add urlencode/urldecode 2019-09-19 16:25:29 +12:00
Jonathan Turner
8a6c700478
Move rustyline to latest stable 2019-09-16 06:18:06 +12:00
Jonathan Turner
88c1b1dc6f Improve default features and don't precompute ls 2019-09-15 13:51:19 +12:00
Andrés N. Robalino
6bb277baaa
Merge pull request #668 from nushell/span-to-tag
Span to tag
2019-09-14 15:10:04 -05:00
Yehuda Katz
ab915f1c44 Revert "Revert "Migrate most uses of the Span concept to Tag""
This reverts commit bee7c5639c.
2019-09-14 11:30:24 -05:00
Jonathan Turner
417916d2da
Switch to rustline git instead of crates.io
There have been a few fixes in rustyline we want to help test, so let's switch to their latest master ahead of the next release.
2019-09-14 11:10:08 +12:00
Jonathan Turner
53cb40d8f6 Add basic 'did you mean' support 2019-09-13 15:44:21 +12:00
Andrés N. Robalino
b35549adac Removes regex crate dependency. 2019-09-11 22:20:42 -05:00
Jonathan Turner
bee7c5639c
Revert "Migrate most uses of the Span concept to Tag" 2019-09-11 19:53:05 +12:00
Yehuda Katz
58b7800172 Migrate most uses of the Span concept to Tag
Also migrate mv, rm and commands like that to taking a
SyntaxType::Pattern instead of a SyntaxType::Path for their first
argument.
2019-09-10 20:41:03 -07:00
Jonathan Turner
448b1a4848 Make some plugins optional, move ps to plugin 2019-09-08 19:06:15 +12:00
Andrés N. Robalino
2cb290b77b
Merge pull request #573 from androbtech/embed
can embed a new field to the table.
2019-09-02 01:14:06 -05:00
Andrés N. Robalino
9488c41dcd can embed a new field to the table 2019-09-02 00:37:13 -05:00
Yehuda Katz
3d5e31c55d
Merge pull request #571 from nushell/bigint
Migrated numerics to BigInt/BigDecimal
2019-09-01 22:08:48 -07:00
Yehuda Katz
8a29c9e6ab Migrated numerics to BigInt/BigDecimal
This commit migrates Value's numeric types to BigInt and BigDecimal. The
basic idea is that overflow errors aren't great in a shell environment,
and not really necessary.

The main immediate consequence is that new errors can occur when
serializing Nu values to other formats. You can see this in changes to
the various serialization formats (JSON, TOML, etc.). There's a new
`CoerceInto` trait that uses the `ToPrimitive` trait from `num_traits`
to attempt to coerce a `BigNum` or `BigDecimal` into a target type, and
produces a `RangeError` (kind of `ShellError`) if the coercion fails.

Another possible future consequence is that certain performance-critical
numeric operations might be too slow. If that happens, we can introduce
specialized numeric types to help improve the performance of those
situations, based on the real-world experience.
2019-09-01 21:00:30 -07:00
Dirkjan Ochtman
8523ce3d01 Get rid of feature(crate_visibility_modifier) (see #362) 2019-09-01 21:56:17 +02:00
Jonathan Turner
1a67ac6102 Random fixes 2019-09-01 09:19:59 +12:00
Jonathan Turner
70ebe899c6
Merge pull request #552 from est31/image_decoding
Remove unused image features
2019-09-01 06:24:42 +12:00
est31
00c5adda80 Remove unused image features 2019-08-31 19:45:09 +02:00
est31
5b7940b88c Update bson to 0.14 2019-08-31 18:47:14 +02:00
Jonathan Turner
0d6b85b5bf
Merge branch 'master' into post 2019-08-31 16:39:24 +12:00
Yehuda Katz
138b5af82b Basic support for decimal numbers
This commit is more substantial than it looks: there was basically no
real support for decimals before, and that impacted values all the way
through.

I also made Size contain a decimal instead of an integer (`1.6kb` is a
reasonable thing to type), which impacted a bunch of code.

The biggest impact of this commit is that it creates many more possible
ways for valid nu types to fail to serialize as toml, json, etc. which
typically can't support the full range of Decimal (or Bigint, which I
also think we should support). This commit makes to-toml fallible, and a
similar effort is necessary for the rest of the serializations.

We also need to figure out how to clearly communicate to users what has
happened, but failing to serialize to toml seems clearly superior to me
than weird errors in basic math operations.
2019-08-30 21:05:32 -07:00
Jonathan Turner
1d77595576 Merge branch 'master' into post 2019-08-31 15:12:03 +12:00
Patrick Meredith
3d147d1143 Add SQLite support 2019-08-30 20:54:45 -04:00
Jonathan Turner
60bfa277d0 Experiment with async/await-enabled ps 2019-08-31 07:07:07 +12:00
Jonathan Turner
9e167713b3 Add post command 2019-08-31 06:27:15 +12:00
Jonathan Turner
39e06bbc80
Merge pull request #511 from svartalf/heim-0.0.7
Heim 0.0.7 preparations
2019-08-31 03:47:50 +12:00
svartalf
213db54378 Update to heim v0.0.7. 2019-08-30 18:08:57 +03:00
Guillaume Gomez
d1f70aff73 Update sysinfo version 2019-08-30 13:25:00 +02:00
Jonathan Turner
605618bef8
Merge pull request #536 from jonathandturner/pin_bson
Pin bson
2019-08-30 15:49:47 +12:00
Jonathan Turner
1f9d5f9f89 Pin bson 2019-08-30 15:24:35 +12:00
Taiki Endo
ffdde542c7 Update futures-preview to 0.3.0-alpha.18 2019-08-29 22:42:49 +09:00
est31
a7d4a8b065 Make neso dependency optional 2019-08-29 01:38:48 +02:00
est31
7ca95ba9dd Remove unused prettyprint dependency 2019-08-29 01:38:39 +02:00
Yehuda Katz
34292b282a Add support for ~ expansion
This ended up being a bit of a yak shave. The basic idea in this commit is to
expand `~` in paths, but only in paths.

The way this is accomplished is by doing the expansion inside of the code that
parses literal syntax for `SyntaxType::Path`.

As a quick refresher: every command is entitled to expand its arguments in a
custom way. While this could in theory be used for general-purpose macros,
today the expansion facility is limited to syntactic hints.

For example, the syntax `where cpu > 0` expands under the hood to
`where { $it.cpu > 0 }`. This happens because the first argument to `where`
is defined as a `SyntaxType::Block`, and the parser coerces binary expressions
whose left-hand-side looks like a member into a block when the command is
expecting one.

This is mildly more magical than what most programming languages would do,
but we believe that it makes sense to allow commands to fine-tune the syntax
because of the domain nushell is in (command-line shells).

The syntactic expansions supported by this facility are relatively limited.
For example, we don't allow `$it` to become a bare word, simply because the
command asks for a string in the relevant position. That would quickly
become more confusing than it's worth.

This PR adds a new `SyntaxType` rule: `SyntaxType::Path`. When a command
declares a parameter as a `SyntaxType::Path`, string literals and bare
words passed as an argument to that parameter are processed using the
path expansion rules. Right now, that only means that `~` is expanded into
the home directory, but additional rules are possible in the future.

By restricting this expansion to a syntactic expansion when passed as an
argument to a command expecting a path, we avoid making `~` a generally
reserved character. This will also allow us to give good tab completion
for paths with `~` characters in them when a command is expecting a path.

In order to accomplish the above, this commit changes the parsing functions
to take a `Context` instead of just a `CommandRegistry`. From the perspective
of macro expansion, you can think of the `CommandRegistry` as a dictionary
of in-scope macros, and the `Context` as the compile-time state used in
expansion. This could gain additional functionality over time as we find
more uses for the expansion system.
2019-08-26 21:03:24 -07:00
Jonathan Turner
472ff74904
Fix build by pinning futures-async-stream
This pins futures-async-stream to fix the current build failure
2019-08-26 10:42:26 +12:00
Patrick Meredith
93a1a0604e Update how extensions are set to default to path when no extension can be determined from mime 2019-08-25 09:50:25 -04:00
Jonathan Turner
721a7b159d switch from reqwest to surf 2019-08-25 07:36:19 +12:00
est31
bd2be874c1 Remove unused unicode-width dependency 2019-08-24 15:57:44 +02:00
est31
651589164a Remove unused strip-ansi-escapes dependency 2019-08-24 15:55:18 +02:00
est31
f893ef03d6 Remove unused derive_more dependency 2019-08-24 15:52:27 +02:00
est31
ba602c4629 Remove unused lazy_static dependency 2019-08-24 15:51:54 +02:00
est31
4fb298aae0 Remove unused adhoc_derive dependency 2019-08-24 15:50:16 +02:00
est31
c811cbe821 Remove unused enum_derive dependency 2019-08-24 15:48:17 +02:00
est31
62e705079e Remove unused logos and logos_derive dependencies 2019-08-24 15:46:53 +02:00
est31
6e135cbc74 Remove unused async_trait dependency 2019-08-24 15:44:13 +02:00