Commit Graph

1019 Commits

Author SHA1 Message Date
Andrés N. Robalino
caa6830184
Baseline environment and configuration work. (#1287) 2020-01-27 22:13:22 -05:00
Jacob Gonzalez
f8be1becf2 Updated rustyline to 6.0.0. Added completion_mode config (#1289)
* Updated rustyline to 6.0.0. Added completion_mode config

* Formatted completion_mode config
2020-01-27 16:41:17 +13:00
Jonathan Turner
6da9e2aced
Upgrade crossterm (#1288)
* WIP

* Finish porting to new crossterm

* Fmt
2020-01-27 15:51:46 +13:00
Jason Gedge
32dfb32741 Switch from subprocess crate to the builtin std::process (#1284)
* Switch from subprocess crate to the builtin std::process

* Update external.rs

* Update external.rs

* Update external.rs

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
2020-01-26 16:03:21 +13:00
Jonathan Turner
d38a63473b
Improve shelling out (#1273)
Improvements to shelling out
2020-01-24 08:24:31 +13:00
Alex van de Sandt
07191754bf Update ichwh to 3.0 (#1267)
The [newest update for ichwh][changes] introduced some breaking changes.
This PR bumps the version and refactors the `which` command to take
these into account.

[changes]: https://gitlab.com/avandesa/ichwh-rs/blob/master/CHANGELOG.md#030-2020-01-22
2020-01-23 12:26:49 +13:00
Yehuda Katz
7efb31a4e4 Restructure and streamline token expansion (#1123)
Restructure and streamline token expansion

The purpose of this commit is to streamline the token expansion code, by
removing aspects of the code that are no longer relevant, removing
pointless duplication, and eliminating the need to pass the same
arguments to `expand_syntax`.

The first big-picture change in this commit is that instead of a handful
of `expand_` functions, which take a TokensIterator and ExpandContext, a
smaller number of methods on the `TokensIterator` do the same job.

The second big-picture change in this commit is fully eliminating the
coloring traits, making coloring a responsibility of the base expansion
implementations. This also means that the coloring tracer is merged into
the expansion tracer, so you can follow a single expansion and see how
the expansion process produced colored tokens.

One side effect of this change is that the expander itself is marginally
more error-correcting. The error correction works by switching from
structured expansion to `BackoffColoringMode` when an unexpected token
is found, which guarantees that all spans of the source are colored, but
may not be the most optimal error recovery strategy.

That said, because `BackoffColoringMode` only extends as far as a
closing delimiter (`)`, `]`, `}`) or pipe (`|`), it does result in
fairly granular correction strategy.

The current code still produces an `Err` (plus a complete list of
colored shapes) from the parsing process if any errors are encountered,
but this could easily be addressed now that the underlying expansion is
error-correcting.

This commit also colors any spans that are syntax errors in red, and
causes the parser to include some additional information about what
tokens were expected at any given point where an error was encountered,
so that completions and hinting could be more robust in the future.

Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
Co-authored-by: Andrés N. Robalino <andres@androbtech.com>
2020-01-21 17:45:03 -05:00
Jonathan Turner
ba9cb753d5
Bump some of our dependencies (#1234) 2020-01-18 09:35:48 +13:00
Andrés N. Robalino
29431e73c2
Externals now spawn independently. (#1230)
This commit changes the way we shell out externals when using the `"$it"` argument. Also pipes per row to an external's stdin if no `"$it"` argument is present for external commands. 

Further separation of logic (preparing the external's command arguments, getting the data for piping, emitting values, spawning processes) will give us a better idea for lower level details regarding external commands until we can find the right abstractions for making them more generic and unify within the pipeline calling logic of Nu internal's and external's.
2020-01-16 04:05:53 -05:00
Andrés N. Robalino
29fd8b55fb
Keep dummies in default features for convenience. (#1212) 2020-01-13 01:17:56 -05:00
Jonathan Turner
02d0a4107e
A few ls improvements. New welcome message (#1195) 2020-01-12 09:49:20 +13:00
Jonathan Turner
41ebc6b42d
Bump to 0.8.0 (#1166) 2020-01-07 20:08:31 +13:00
Jonathan Turner
77d856fd53
Last unwraps (#1160)
* Work through most of the last unwraps

* Finish removing unwraps
2020-01-04 19:44:17 +13:00
Jonathan Turner
25298d35e4
Bump rustyline (#1146)
* Slightly improve new which command

* Bump rustyline
2020-01-02 06:54:25 +13:00
Alex van de Sandt
b304de8199 Rewrite which (#1144)
* Detect built-in commands passed as args to `which`

This expands the built-in `which` command to detect nushell commands
that may have the same name as a binary in the path.

* Allow which to interpret multiple arguments

Previously, it would discard any argument besides the first. This allows
`which` to process multiple arguments. It also makes the output a stream
of rows.

* Use map to build the output

* Add boolean column for builtins

* Use macros for entry creation shortcuts

* Process command args and use async_stream

In order to use `ichwh`, I'll need to use async_stream. But in order to
avoid lifetime errors with that, I have to process the command args
before using them. I'll admit I don't fully understand what is going on
with the `args.process(...)` function, but it works.

* Use `ichwh` for path searching

This commit transitions from `which` to `ichwh`. The path search is now
done asynchronously.

* Enable the `--all` flag on `which`

* Make `which` respect external commands

Escaped commands passed to wich (e.g., `which "^ls"`), are now searched
before builtins.

* Fix clippy warnings

This commit resolves two warnings from clippy, in light of #1142.

* Update Cargo.lock to get new `ichwh` version

`ichwh@0.2.1` has support for local paths.

* Add documentation for command
2020-01-01 19:45:27 +13:00
Andrés N. Robalino
0615adac94
Inc refactoring, Value helper test method extractions, and more integration helpers. (#1135)
* Manifests check. Ignore doctests for now.

* We continue with refactorings towards the separation of concerns between
crates. `nu_plugin_inc` and `nu_plugin_str` common test helpers usage
has been refactored into `nu-plugin` value test helpers.

Inc also uses the new API for integration tests.
2019-12-29 00:17:24 -05:00
Andrés N. Robalino
f6c62bf121 Nu plugins now depend on nu-plugin crate. 2019-12-27 08:52:15 -05:00
Jonathan Turner
0c786bb890 Bump to 0.7.2 2019-12-24 14:51:10 +13:00
Jonathan Turner
e7fb15be59 Fix an assortment of issues 2019-12-24 14:26:47 +13:00
Jonathan Turner
367f11a62e Bump nu version 2019-12-20 09:03:54 +13:00
Jonathan Turner
b629136528 Fix the workspace I commented out 2019-12-19 06:58:23 +13:00
Jonathan Turner
96484161c0 Copy core plugins back so we can publish 2019-12-19 05:35:17 +13:00
Jonathan Turner
08571392e6 Rename test-support to nu-test-support 2019-12-18 07:41:47 +13:00
Jonathan Turner
14817ef229 Subcrate versions 2019-12-18 05:18:10 +13:00
Jonathan Turner
6540509911 Bump Nu version 2019-12-18 04:55:49 +13:00
Andrés N. Robalino
4034129dba This commit is the continuing phase of extracting functionality to subcrates. We extract test helpers and begin to change Nu shell's test organization along with it. 2019-12-15 11:34:58 -05:00
Jonathan Turner
31c703891a Bump heim and necessary deps 2019-12-15 02:27:14 +13:00
Yehuda Katz
57af9b5040 Add Range and start Signature support
This commit contains two improvements:

- Support for a Range syntax (and a corresponding Range value)
- Work towards a signature syntax

Implementing the Range syntax resulted in cleaning up how operators in
the core syntax works. There are now two kinds of infix operators

- tight operators (`.` and `..`)
- loose operators

Tight operators may not be interspersed (`$it.left..$it.right` is a
syntax error). Loose operators require whitespace on both sides of the
operator, and can be arbitrarily interspersed. Precedence is left to
right in the core syntax.

Note that delimited syntax (like `( ... )` or `[ ... ]`) is a single
token node in the core syntax. A single token node can be parsed from
beginning to end in a context-free manner.

The rule for `.` is `<token node>.<member>`. The rule for `..` is
`<token node>..<token node>`.

Loose operators all have the same syntactic rule: `<token
node><space><loose op><space><token node>`.

The second aspect of this pull request is the beginning of support for a
signature syntax. Before implementing signatures, a necessary
prerequisite is for the core syntax to support multi-line programs.

That work establishes a few things:

- `;` and newlines are handled in the core grammar, and both count as
  "separators"
- line comments begin with `#` and continue until the end of the line

In this commit, multi-token productions in the core grammar can use
separators interchangably with spaces. However, I think we will
ultimately want a different rule preventing separators from occurring
before an infix operator, so that the end of a line is always
unambiguous. This would avoid gratuitous differences between modules and
repl usage.

We already effectively have this rule, because otherwise `x<newline> |
y` would be a single pipeline, but of course that wouldn't work.
2019-12-11 16:41:07 -08:00
Jonathan Turner
1dcbd89a89 Trying this as a workaround to the [[bin]] issue 2019-12-10 16:57:55 +13:00
Jonathan Turner
e2a95c3e1d Move str and inc to core plugins 2019-12-10 13:59:13 +13:00
Jonathan Turner
88f899d341 Move some plugins back to being core shippable plugins 2019-12-10 13:05:40 +13:00
Jonathan Turner
9f702fe01a Move the remainder of the plugins to crates 2019-12-10 07:39:51 +13:00
Jonathan Turner
91784218c0 Upgrade some dependencies 2019-12-09 06:56:21 +13:00
Jonathan Turner
8833969e4a Remove some unused deps 2019-12-07 20:23:29 +13:00
Jonathan Turner
38b7a3e32b WIP move post/fetch to plugins 2019-12-07 16:46:05 +13:00
Jonathan Turner
d12c16a331 Extract ps and sys subcrates. Move helper methods to UntaggedValue 2019-12-05 08:52:31 +13:00
Jonathan Turner
a4bb5d4ff5 Move binaryview to a sub-crate 2019-12-05 06:51:20 +13:00
Jonathan Turner
cfda67ff82 Finish making the textview plugin optional 2019-12-05 05:28:48 +13:00
Jonathan Turner
1fcf671ca4 Re-enable the textview plugin, now its own crate 2019-12-04 19:38:40 +13:00
Jonathan Turner
efc879b955 Add new line primitive, bump version, allow bare filepaths 2019-12-03 19:44:59 +13:00
Yehuda Katz
24bad78607 Clean up expansion of external words
Previously, external words accidentally used
ExpansionRule::new().allow_external_command(), when it should have been
ExpansionRule::new().allow_external_word().

External words are the broadest category in the parser, and are the
appropriate category for external arguments. This was just a mistake.
2019-12-02 16:34:33 -08:00
Yehuda Katz
87dbd3d5ac Extract build.rs 2019-12-02 13:14:51 -08:00
est31
d6a6e16d21 Switch to the new Cargo.lock format
This was achieved by deleting Cargo.lock
and letting a recent Cargo nightly re-create
it. Support for the format was already
introduced in Rust 1.38, but currently,
stable releases of Cargo only retain it
if encountered but don't generate such
files by default.

The new format is smaller, better suited to
prevent merge conflicts and generates smaller
diffs at dependency updates, leading to
smaller git history.

You can read more about it in this PR: https://github.com/rust-lang/cargo/pull/7070
2019-12-02 11:02:59 -08:00
Jonathan Turner
388ce738e3 expand tilde in externals 2019-12-02 11:02:58 -08:00
Jonathan Turner
80941ace37 Add 0.6.1 release 2019-12-02 11:02:58 -08:00
Jonathan Turner
1fb5a419a7 Bump the release version 2019-12-02 11:02:57 -08:00
Yehuda Katz
e4226def16 Extract core stuff into own crates
This commit extracts five new crates:

- nu-source, which contains the core source-code handling logic in Nu,
  including Text, Span, and also the pretty.rs-based debug logic
- nu-parser, which is the parser and expander logic
- nu-protocol, which is the bulk of the types and basic conveniences
  used by plugins
- nu-errors, which contains ShellError, ParseError and error handling
  conveniences
- nu-textview, which is the textview plugin extracted into a crate

One of the major consequences of this refactor is that it's no longer
possible to `impl X for Spanned<Y>` outside of the `nu-source` crate, so
a lot of types became more concrete (Value became a concrete type
instead of Spanned<Value>, for example).

This also turned a number of inherent methods in the main nu crate into
plain functions (impl Value {} became a bunch of functions in the
`value` namespace in `crate::data::value`).
2019-12-02 10:54:12 -08:00
Yehuda Katz
f70c6d5d48 Extract nu_source into a crate
This commit extracts Tag, Span, Text, as well as source-related debug
facilities into a new crate called nu_source.

This change is much bigger than one might have expected because the
previous code relied heavily on implementing inherent methods on
`Tagged<T>` and `Spanned<T>`, which is no longer possible.

As a result, this change creates more concrete types instead of using
`Tagged<T>`. One notable example: Tagged<Value> became Value, and Value
became UntaggedValue.

This change clarifies the intent of the code in many places, but it does
make it a big change.
2019-11-25 07:37:33 -08:00
Yehuda Katz
cdb0eeafa2 --no-edit 2019-11-21 14:22:32 -08:00
Jonathan Turner
111fcf188e Add umask to unix --full list 2019-11-19 18:46:47 +13:00
Jonathan Turner
90aeb700ea Add from_xlsx for importing excel files 2019-11-17 16:18:41 +13:00
Jonathan Turner
db218e06dc Give rustyline non-ansi to begin with. Fixes Windows 2019-11-17 09:02:26 +13:00
Jonathan Turner
07db14f72e Merge master 2019-11-17 06:17:05 +13:00
Andrés N. Robalino
87d58535ff Downgrade futures-codec. 2019-11-12 14:04:53 -05:00
Jonathan Turner
0f405f24c7 Bump dep versions 2019-11-11 06:48:49 +13:00
Jonathan Turner
df302d4bac Bump Nu version and change plugin load logic for debug 2019-11-10 16:44:05 +13:00
Jonathan Turner
4cb399ed70 Bump version to 0.5.0 2019-11-06 18:24:04 +13:00
Yehuda Katz
4be88ff572 Modernize external parse and improve trace
The original purpose of this PR was to modernize the external parser to
use the new Shape system.

This commit does include some of that change, but a more important
aspect of this change is an improvement to the expansion trace.

Previous commit 6a7c00ea adding trace infrastructure to the syntax coloring
feature. This commit adds tracing to the expander.

The bulk of that work, in addition to the tree builder logic, was an
overhaul of the formatter traits to make them more general purpose, and
more structured.

Some highlights:

- `ToDebug` was split into two traits (`ToDebug` and `DebugFormat`)
  because implementations needed to become objects, but a convenience
  method on `ToDebug` didn't qualify
- `DebugFormat`'s `fmt_debug` method now takes a `DebugFormatter` rather
  than a standard formatter, and `DebugFormatter` has a new (but still
  limited) facility for structured formatting.
- Implementations of `ExpandSyntax` need to produce output that
  implements `DebugFormat`.

Unlike the highlighter changes, these changes are fairly focused in the
trace output, so these changes aren't behind a flag.
2019-11-01 08:45:45 -07:00
Jonathan Turner
d160e834eb rustyline git and add plus for filenames 2019-10-26 05:43:31 +13:00
jdvr
fc1301c92d #194 Added trash crate and send files to the trash using a flag 2019-10-19 00:41:24 +02:00
Jonathan Turner
d91b735442 Update cargo.lock 2019-10-16 15:09:47 +13:00
Jonathan Turner
2716bb020f
Fix #811 (#813) 2019-10-13 17:53:58 +13:00
Jonathan Turner
193b00764b
Stream support (#812)
* Moves off of draining between filters. Instead, the sink will pull on the stream, and will drain element-wise. This moves the whole stream to being lazy.
* Adds ctrl-c support and connects it into some of the key points where we pull on the stream. If a ctrl-c is detect, we immediately halt pulling on the stream and return to the prompt.
* Moves away from having a SourceMap where anchor locations are stored. Now AnchorLocation is kept directly in the Tag.
* To make this possible, split tag and span. Span is largely used in the parser and is copyable. Tag is now no longer copyable.
2019-10-13 17:12:43 +13:00
Yehuda Katz
439889dcef Feature flagging infrastructure
This commit adds the ability to work on features behind a feature flag
that won't be included in normal builds of nu.

These features are not exposed as Cargo features, as they reflect
incomplete features that are not yet stable.

To create a feature, add it to `features.toml`:

```toml
[hintsv1]

description = "Adding hints based on error states in the highlighter"
enabled = false
```

Each feature in `features.toml` becomes a feature flag accessible to `cfg`:

```rs
println!("hintsv1 is enabled");
```

By default, features are enabled based on the value of the `enabled` field.

You can also enable a feature from the command line via the
`NUSHELL_ENABLE_FLAGS` environment variable:

```sh
$ NUSHELL_ENABLE_FLAGS=hintsv1 cargo run
```

You can enable all flags via `NUSHELL_ENABLE_ALL_FLAGS`.

This commit also updates the CI setup to run the build with all flags off and
with all flags on. It also extracts the linting test into its own
parallelizable test, which means it doesn't need to run together with every
other test anymore.

When working on a feature, you should also add tests behind the same flag. A
commit is mergable if all tests pass with and without the flag, allowing
incomplete commits to land on master as long as the incomplete code builds and
passes tests.
2019-10-11 17:19:44 -07:00
Yehuda Katz
1ad9d6f199 Overhaul the expansion system
The main thrust of this (very large) commit is an overhaul of the
expansion system.

The parsing pipeline is:

- Lightly parse the source file for atoms, basic delimiters and pipeline
  structure into a token tree
- Expand the token tree into a HIR (high-level intermediate
  representation) based upon the baseline syntax rules for expressions
  and the syntactic shape of commands.

Somewhat non-traditionally, nu doesn't have an AST at all. It goes
directly from the token tree, which doesn't represent many important
distinctions (like the difference between `hello` and `5KB`) directly
into a high-level representation that doesn't have a direct
correspondence to the source code.

At a high level, nu commands work like macros, in the sense that the
syntactic shape of the invocation of a command depends on the
definition of a command.

However, commands do not have the ability to perform unrestricted
expansions of the token tree. Instead, they describe their arguments in
terms of syntactic shapes, and the expander expands the token tree into
HIR based upon that definition.

For example, the `where` command says that it takes a block as its first
required argument, and the description of the block syntactic shape
expands the syntax `cpu > 10` into HIR that represents
`{ $it.cpu > 10 }`.

This commit overhauls that system so that the syntactic shapes are
described in terms of a few new traits (`ExpandSyntax` and
`ExpandExpression` are the primary ones) that are more composable than
the previous system.

The first big win of this new system is the addition of the `ColumnPath`
shape, which looks like `cpu."max ghz"` or `package.version`.
Previously, while a variable path could look like `$it.cpu."max ghz"`,
the tail of a variable path could not be easily reused in other
contexts. Now, that tail is its own syntactic shape, and it can be used
as part of a command's signature.

This cleans up commands like `inc`, `add` and `edit` as well as
shorthand blocks, which can now look like `| where cpu."max ghz" > 10`
2019-10-10 08:27:51 -07:00
Barnaby Keene
47150efc14 chore: switch starship dependency back to the main one 2019-10-09 08:36:55 +01:00
Barnaby Keene
ef3e8eb778 fix: update Cargo.lock with correct hash for starship fork 2019-10-08 21:16:52 +01:00
Barnaby Keene
fb8cfeb70d feat: starship prompt
Kind of touches on #356 by integrating the Starship prompt directly into the shell.

Not finished yet and has surfaced a potential bug in rustyline anyway. It depends on https://github.com/starship/starship/pull/509 being merged so the Starship prompt can be used as a library.

I could have tackled #356 completely and implemented a full custom prompt feature but I felt this was a simpler approach given that Starship is both written in Rust so shelling out isn't necessary and it already has a bunch of useful features built in.

However, I would understand if it would be preferable to just scrap integrating Starship directly and instead implement a custom prompt system which would facilitate simply shelling out to Starship.
2019-10-08 16:25:12 +01:00
rnxypke
9fb9adb6b4 add regex match plugin 2019-10-02 20:56:43 +02:00
est31
02d6614ae2 Use language-reporting from git as it supports Rust stable 2019-09-28 03:11:01 +02:00
est31
1801c006ec Remove futures-async-stream dependency 2019-09-28 02:07:28 +02:00
est31
9891e5ab81 Use async-stream crate to replace most async_stream_block invocations 2019-09-26 02:39:20 +02:00
Jonathan Turner
ffa536bea3 Add Cargo.lock 2019-09-25 07:02:35 +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
7fbd6ce232 Fix internal paths 2019-09-17 14:09:15 +12:00
Jonathan Turner
88c1b1dc6f Improve default features and don't precompute ls 2019-09-15 13:51:19 +12: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
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
est31
b14fd12e47 Update rust-argon2 in Cargo.lock
Rids us of crossbeam v0.5 and lots of other crates.
For most users this only effects Cargo.lock though,
as rust-argon2 is only compiled when targeting
redox.
2019-09-06 10:34:31 +02: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
Taiki Endo
ffdde542c7 Update futures-preview to 0.3.0-alpha.18 2019-08-29 22:42:49 +09: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
Patrick Meredith
a75c90cc42 Rebase on master 2019-08-25 10:16:22 -04:00
Jonathan Turner
721a7b159d switch from reqwest to surf 2019-08-25 07:36:19 +12:00
Jonathan Turner
ea86d14673
Merge pull request #366 from aidanharris/update-openssl-sys
Update openssl-sys to v0.9.49 for libressl-3.0.0
2019-08-25 03:58:26 +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
est31
f6cf6f6768 Remove unused chrono-tz dependency 2019-08-24 15:42:28 +02:00
est31
aa9685e9a3 Also remove toml-query as it's not used 2019-08-24 09:58:25 +02:00
est31
9593007fea Remove unused tempdir dependency 2019-08-24 09:49:36 +02:00
Aidan Harris
e32ac882de
Update openssl-sys to v0.9.49 for libressl-3.0.0 2019-08-24 08:21:12 +01:00
Tom Forbes
9e2fc1c06d
Disable default git2 features 2019-08-23 23:59:05 +01:00
Jonathan Turner
bc6dc030c2 Fix bug in textview with rawkey 2019-08-24 06:51:03 +12:00
Jonathan Turner
6354e0cc55 Remove X11 requirement 2019-08-23 15:29:08 +12:00
Jonathan Turner
e3e4e30fb3 Lots of fixes ahead of release 2019-08-21 18:39:57 +12:00
Jonathan Turner
eb6e24c220 Wrap table cells as needed 2019-08-16 17:47:47 +12:00
Jonathan Turner
785536983a
Revert "Heuristic table view" 2019-08-16 04:49:07 +12:00
Jonathan Turner
123b1856c8 Attempt heuristic table 2019-08-13 19:45:31 +12:00
Jonathan Turner
6cf3dc92fc Add support for utf16 files 2019-08-12 16:11:42 +12:00
Jonathan Turner
8e652850dc add some battery stats 2019-08-11 15:01:09 +12:00
Jonathan Turner
e19c618ac5
Revert "Rewrite the ps command" 2019-08-11 13:41:21 +12:00
Jonathan Turner
7c2fec5851 Rewrite the ps command 2019-08-11 11:09:40 +12:00
Jonathan Turner
894958d5e8 Improve sys a bit 2019-08-11 10:13:03 +12:00
Jonathan Turner
1662824a5c Revert bump 2019-08-10 18:31:31 +12:00
Jonathan Turner
60e7dfcf1b Add back command completions 2019-08-10 17:02:15 +12:00
Jonathan Turner
aadacc2d36 Merge master 2019-08-09 16:51:21 +12:00
Jonathan Turner
bcd9d2d1a6 Pin semver breaking dep 2019-08-09 05:33:19 +12:00
Jonathan Turner
c231dd32cd
Multi shells (#254)
Add multi-shells
2019-08-08 05:49:11 +12:00
Yehuda Katz
fc173c46d8 Restructuring 2019-08-02 12:15:07 -07:00
Jonathan Turner
c42369f1f6 Move off of git deps 2019-08-02 15:58:10 +12:00
Andrés N. Robalino
375f311331 Wildcard support adventure starting with rm command. 2019-08-01 16:01:53 -05:00
Jonathan Turner
509dfe72a8 Switch to rustyline nightly 2019-07-31 05:57:22 +12:00
Jonathan Turner
bd639b52ff bump deps 2019-07-29 19:46:24 +12:00
Jonathan Turner
403f9d2499
Revert "Switch way of doing terminal size calculation" 2019-07-29 16:18:11 +12:00
Jonathan Turner
5a4805d422 Switch way of doing terminal size calculation 2019-07-29 05:34:04 +12:00
Jonathan Turner
a09361698e Update plugin protocol for begin, and create new sys plugin 2019-07-27 19:45:00 +12:00
Jonathan Turner
1f26101e2f Yet more improvements to textview (and binaryview) 2019-07-26 04:22:22 +12:00
Jonathan Turner
568931c80c add basic paging to text views 2019-07-24 19:44:12 +12:00
Yehuda Katz
73deeb69db Clean up lint errors 2019-07-23 21:10:48 -07:00
Jonathan Turner
1e6a9b9b34 Merge branch 'master' into source_spans 2019-07-20 13:14:05 +12:00
Jonathan Turner
27dbc1cb9a Add syntect (and borrow bat's theme file) 2019-07-20 13:12:04 +12:00
Andrés N. Robalino
895a1b2d72 Introduced ability to open csv documents. 2019-07-19 15:48:42 -05:00
Jonathan Turner
d5d4da0bf8 Add first step of uuid generation and bookkeeping 2019-07-20 07:48:14 +12:00
Jonathan Turner
227fdddc12 Add yaml roundtrip test. Bump nu version 2019-07-18 05:51:53 +12:00
Jonathan Turner
048b378e56 Remove failing tests and bump nom5_locate 2019-07-17 07:36:25 +12:00
Jonathan Turner
2ed46046bd Cleanup for upcoming release 2019-07-17 07:10:25 +12:00
Jonathan Turner
ae4d3ab4cf Bump deps and add serde_bytes support 2019-07-16 06:34:44 +12:00
Jonathan Turner
7e555a0ef2 "Add plugin arg errors. Bring remaining errors to parity" 2019-07-14 04:59:59 +12:00
Jonathan Turner
958bb534b4 Finish moving a couple commands to plugins, remove unused plugin 2019-07-06 05:19:19 +12:00
Jonathan Turner
ea997289d9 Add some logic for more binary formats 2019-07-05 19:53:09 +12:00
Jonathan Turner
563fabfdca Small cleanup, hopefull unbroken lock file 2019-07-05 13:01:19 +12:00
Jonathan Turner
73d87e57ab Switch to rawkey reader. Add more binary reading 2019-07-05 10:17:18 +12:00
Jonathan Turner
5e779d8b2b Add pretty binary viewing 2019-07-04 17:23:05 +12:00
Jonathan Turner
c653751d2c Bump and cleanup plugin name match 2019-07-04 15:06:43 +12:00
Jonathan Turner
0180769971 WIP now load plugins automatically 2019-07-04 05:37:09 +12:00
Jonathan Turner
c3697c67ca Make serialization full-fidelity 2019-06-30 18:46:49 +12:00
Jonathan Turner
d5704808d4 First working plugin 2019-06-27 16:56:48 +12:00
Jonathan Turner
6315e5c692 Remove unused deps 2019-06-27 06:24:42 +12:00
Jonathan Turner
c819126d00 Bump deps 2019-06-27 06:08:41 +12:00
Jonathan Turner
cfcf43ca93 Add content-type to open, refactor open/enter 2019-06-26 19:40:43 +12:00
Jonathan Turner
af82f44e13 Merge master, fix conflicts 2019-06-24 05:54:02 +12:00
Jonathan Turner
3d893d5afc Update sysinfo for better subsystem selection 2019-06-24 05:21:09 +12:00
Yehuda Katz
6af4dafd87 Update lockfile 2019-06-22 18:31:05 -04:00
Jonathan Turner
0046305ea1 Fix conflicts 2019-06-23 04:31:51 +12:00
Jonathan Turner
9ae9beb94a WIP 2019-06-22 15:43:37 +12:00
Jonathan Turner
baeb192f12 Merge master 2019-06-22 13:38:17 +12:00
Yehuda Katz
e981129f1f Things work 2019-06-21 21:36:57 -04:00
Jonathan Turner
3f718a20be Add a system info source 2019-06-19 16:53:55 +12:00
Jonathan Turner
a764a64161 Move back onto main subprocess 2019-06-18 14:04:34 +12:00
Jonathan Turner
1000ec21b5 Add .ini loading/saving 2019-06-16 18:43:40 +12:00
Yehuda Katz
4f3a5f0300 Paths 2019-06-14 20:16:13 -07:00
Yehuda Katz
c5c14e2d89 Add a bunch more tokens and delimited () 2019-06-14 20:16:13 -07:00
Yehuda Katz
4291e31dc7 Start rebuilding lite parser using nom 2019-06-14 20:16:13 -07:00
Jonathan Turner
22f9126cf6 merge master and fix conflict 2019-06-11 18:27:19 +12:00
Jonathan Turner
7642541755 Add xml open support 2019-06-11 18:26:03 +12:00
Yehuda Katz
2b876da56f Some function stuff
It's not done, but honestly it's getting too tedious. I will need to
rethink how I'm doing it.
2019-06-10 13:11:55 -07:00
Jonathan Turner
183a0138bf Temporarily switch to fixed branch 2019-06-10 19:32:30 +12:00
Jonathan Turner
62fac11e07 Cleanup and bump rustyline 2019-06-10 05:52:56 +12:00
Jonathan Turner
4e6c3d255c Add opening urls 2019-06-09 06:09:17 +12:00
Jonathan Turner
7d53592174 Add clipboard support 2019-06-08 04:30:50 +12:00
Jonathan Turner
7c794dc189 Add tree sink 2019-06-07 19:50:26 +12:00
Odin Dutton
b79dc2257c Handle Ctrl-C gracefully 2019-06-07 10:31:22 +10:00
Jonathan Turner
c050ce852b Lots of misc improvements 2019-06-03 19:41:28 +12:00
Jonathan Turner
9ba42eae46 Fix up tests 2019-06-03 12:03:40 +12:00
Jonathan Turner
2997d24f16
Merge branch 'master' into testing 2019-06-03 05:51:11 +12:00
Yehuda Katz
b9159f033b Parsing tests 2019-06-02 09:28:40 -07:00
Jonathan Turner
d6cd0df232 Add git branch to prompt 2019-06-02 09:11:28 +12:00
Yehuda Katz
5d4097073b Add --loglevel and --develop
--loglevel sets the log level for all of nu
--develop takes a list of modules and turns on trace mode for them
2019-06-01 10:00:42 -07:00
Yehuda Katz
69effbc9e7 Improve signature infrastructure
The `config` command uses different kinds of named arguments, which
illustrates how it works.
2019-05-31 22:54:15 -07:00
Yehuda Katz
b7d15c2afd Better errors and more fleshed out semantics 2019-05-29 21:19:46 -07:00
Yehuda Katz
e4013a008c Custom lexer 2019-05-29 08:26:45 -07:00
Yehuda Katz
d5255f6dbf
Evaluator MVP (#39)
Evaluator, MVP
2019-05-27 23:45:18 -07:00
Jonathan Turner
b34676441b Add json support 2019-05-28 14:01:37 +12:00
Yehuda Katz
b74daa2e60 A real parser (lalrpop) 2019-05-26 00:17:35 -07:00
Jonathan Turner
e73f489aeb Make our own LinesCodec 2019-05-25 12:07:52 -07:00
Yehuda Katz
9f8d2a4de5 Pipe external to internal
Each line is a string object
2019-05-24 11:48:33 -07:00
Yehuda Katz
bf332ea50c Improved streams 2019-05-23 21:34:43 -07:00
Yehuda Katz
31dd579d6f Small restructuring 2019-05-22 21:30:43 -07:00
Yehuda Katz
261d7a793f Restructure and make commands uniform 2019-05-22 00:12:03 -07:00
Yehuda Katz
89712bf1eb Fix manifest 2019-05-17 20:17:29 -07:00
Yehuda Katz
67d18df214 Bump version 2019-05-17 20:16:06 -07:00
Yehuda Katz
c30fc32b0c Bat 2019-05-17 18:24:13 -07:00
Yehuda Katz
2feef6bd25 Added a first pass at sort-by 2019-05-17 08:55:50 -07:00
Yehuda Katz
11677735f1 Fix Linux/Windows build on nightly 2019-05-16 23:37:35 -07:00
Yehuda Katz
90f4ba15cf Update name 2019-05-16 16:39:58 -07:00
Jonathan Turner
b342069fd5 Workaround color prompt by making our own helper 2019-05-16 06:06:46 -07:00
Yehuda Katz
638093aad6 Rename to nushell 2019-05-15 17:55:32 -07:00
Yehuda Katz
8f327477e7 Internals cleanup and | select ...fields 2019-05-15 13:14:51 -05:00
Yehuda Katz
ceb0487eba A bunch of rework
I'm gonna use a VecDeque now instead of trying to get async streams
working to make progress, but the intent is that we should be able to
use async streams in and out to interleave the work better.
2019-05-13 13:30:51 -04:00
Yehuda Katz
51e921b085 A bit more infra 2019-05-11 00:00:33 -07:00
Yehuda Katz
e44d657424 Simple parsing 2019-05-10 21:45:57 -07:00
Yehuda Katz
8f3b273337 objectshell initial commit 2019-05-10 09:59:12 -07:00