* removed rustyline config duplication
set other rustyline defaults if line_editor section doesn't exist
updated keyseq_timeout to -1 if emacs mode is chosen
* change checking rustyline config to if lets
* removed some unneccessary code
Refactored out most of internal work for summarizing data opening
the door for generating charts from it. A model is introduced
to hold information needed for a summary, Histogram command is
an example of a partial usage. This is the beginning.
Removed implicit arithmetic traits on Value and Primitive to avoid
mixed types panics. The std operations traits can't fail and we
can't guarantee that. We can handle gracefully now since compute_values
was introduced after the parser changes four months ago. The handling
logic should be taken care of either explicitly or in compute_values.
The zero identity trait was also removed (and implementing this forced
us to also implement Add, Mult, etc)
Also: the `math` operations now remove in the output if a given column is not computable:
```
> ls | math sum
──────┬──────────
size │ 150.9 KB
──────┴──────────
```
* Delete unnecessary match
* Use `unwrap_or_else()`
* Whitespace was trim on file save
* Use `map_or_else()`
* Use a default to group all match arms with same output
* Clippy made me do it
* Move lite_parse tests into a submodule
* Have lite_parse return partial parses when error encountered.
Although a parse fails, we can generally still return what was successfully
parsed. This is useful, for example, when figuring out completions at some
cursor position, because we can map the cursor to something more structured
(e.g., cursor is at a flag name).
* Add two further path cmds - type and exists
* Update type.rs
Try a more universal directory
* Update type.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
* Add new path commands
basename, expand and extension. Currently there is no real error
handling. expand returns the initial path if it didn't work, the others
return empty string
* Optionally apply to path
- Removing old code for dealing with escaping, since that has moved elsewhere.
- Eliminating some match statements in favour of result/option methods.
- Fix an issue where completing inside quotes could remove the quote at the
beginning, if one already existed on the line but the replacement didn't have
a quote at the beginning.
* Refactor all completion logic into `NuCompleter`
This is the next step to improving completions. Previously, completion logic was
scattered about (`FilesystemShell`, `NuCompleter`, `Helper`, and `ShellManager`).
By unifying the core logic into a central location, it will be easier to take the
next steps in improving completion.
* Update context.rs
Co-authored-by: Jonathan Turner <jonathandturner@users.noreply.github.com>
In any other shell, stderr is inherited like normal, and only piped if you
request it explicitly (e.g., `2>/dev/null`). In the case of a command like
`fzf`, stderr is used for the interactive selection of files. By piping it,
something like
fzf | xargs echo
does not work. By removing all stderr piping we eliminate this issue. We can
return later with a way to deal with stderr piping when an actual use case
arises.