* Allow keeping selected env from removed overlay
* Remove some duplicate code
* Change --keep-all back to --keep-custom
Because, apparently, you cannot have a named flag called --keep-all,
otherwise tests fail?
* Fix missing line and wrong test value
* add bytes collect
* index_of support searching from end
* add bytes remove
* make bytes replace work better for empty pattern
* add bytes build
* remove comment
* tweak words
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
* (WIP) Initial messy support for hooks as strings
* Cleanup after running condition & hook code
Also, remove prints
* Move env hooks eval into its own function
* Add env change hooks to simulator
* Fix hooks simulator not running env hooks properly
* Add missing hooks test file
* Expand hooks tests
* Add blocks as env hooks; Preserve hook environment
* Add full eval to pre prompt/exec hooks; Fix panic
* Rename env change hook back to orig. name
* Print err on test failure; Add list of hooks test
* Consolidate condition block; Fix panic; Misc
* CHange test to use real file
* Remove unused stuff
* Fix potential panics; Clean up errors
* Remove commented unused code
* Clippy: Fix extra references
* Add back support for old-style hooks
* Reorder functions; Fmt
* Fix test on Windows
* Add more test cases; Simplify some error reporting
* Add more tests for setting correct before/after
* Move pre_prompt hook to the beginning
Since we don't have a prompt or blocking on user input, all hooks just
follow after each other.
* Avoid extending the directory without globs in `nu_engine::glob_from`
* avoid joining a `*` to the directory without globs
* remove checks on directory permission and whether it is empty
The previous implemention of `nu_engine::glob_from` will extend the
given directory even if it containes no glob pattern. This commit
overcomes lack of consistency with the function `nu_glob::glob`.
* Add flag -D to ls, to list the directory itself instead of its contents
* add --directory (-d) flag to ls
* correct the difference between the given path and the cwd
* set default path to `.` instead of `./*` when --directory (-d) flag is true
* add comments
* add an example
* add tests
* fmt
* Add all flag
* Make all and moduel flags as mutually exclusive
* Fix new test
* format code...
* tweak words
* another tweak
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
* Return error when external command core dumped
Fixes#5903
Signed-off-by: nibon7 <nibon7@163.com>
* Use signal-hook to get signal name
Signed-off-by: nibon7 <nibon7@163.com>
* Fix comment
Signed-off-by: nibon7 <nibon7@163.com>
* ensure `required` positionals show up as `required` when `help`
* moves it to the older format
* standardises across optional and required parameters
* adds `capture-errors` flag for `do`
* adds `get-type` core command to get type
* fmt
* add tests in example
* fmt
* fix tests
* manually revert previous changes related to `get-type`
* adds method to check for error name using `into string`
* fix clippy
For instance,
```
echo 'abcdefghijklmnopqrstuvwxyz' | hash sha256 --binary
```
Will returns the hash as a binary value instead of a hexadecimaly encoded string.
* feat: deprecate `hash base64` command
* feat: extend `decode` and `encode` command families
This commit
- Adds `encode` command family
- Backports `hash base64` features to `encode base64` and `decode base64` subcommands.
- Refactors code a bit and extends tests for encodings
- `decode base64` returns a binary `Value` (that may be decoded into a string using `decode` command)
* feat: add `--binary(-b)` flag to `decode base64`
Default output type is now string, but binary can be requested using this new flag.
* fixes the issue for 'open' and other commands that explicitly use `SyntaxShape::Filepath`
* fixes for `rm` and similar commands
* fixes for `ls`: potentially breaking?
* fmt
* a curious fix to the test
* a curious fix to the test, except for Windows this time
* fixes Windows tests failing
* resolves it by putting an explicit check for `ls`
* reverts unnecessary test changes; fmt
* changes the order of completion operations
This PR adds support for an SQLite history via nushell/reedline#401
The SQLite history is enabled by setting history_file_format: "sqlite" in config.nu.
* somewhat working sqlite history
* Hook up history command
* Fix error in SQlitebacked with empty lines
When entering an empty line there previously was the "No command run"
error with `SqliteBackedHistory` during addition of the metadata
May be considered a temporary fix
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
* 06-07-wsl
* 06-07-linux-issue-with-delete-input
* 06-08-2023
* 06-08-Linux
* commit for merge
* Fix unit test
* format
* clean code
* Add flag to turn off external completion
* change env var to config
* Fix comment
Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
* Fix drop nth bug on ranges. Should fix & close#5260
* Fix drop nth bug on ranges. Should fix & close#5260
* Add support for ranges
* Working version of drop nth, but the issue is that we unwrap the value which is problematic for Streams. Should convert to the way @stormasm was doing it before and implement the range check
* Fix fmt issue
* Drop nth now works for Lists, Records, and Ranges. We need support for ListStreams and for ExternalStreams
* Keep consistent naming
* Fix fmt issue
* Support ListStreams for drop nth
* Use DropNthIterator instead
* Found a more elegant way to deal with the check for no upper bound input
* Add extra checks for negative inputs or to < from for ranges
Co-authored-by: Stefan Stanciulescu <test@test.com>
* attempts to add `div` math operator
* allows `//` to be used too
* fmt:
* clippy issue
* returns appropriate type
* returns appropriate type 2
* fmt
* ensure consistency; rename to `fdiv`
* Update parser.rs
* input and output tests
* input and output types for dfr
* expression converter
* remove deprecated command
* correct expressions
* cargo clippy
* identifier for ls
* cargo clippy
* type for head and tail expression
* modify full cell path if block
* 06-07-wsl
* 06-07-linux-issue-with-delete-input
* 06-08-2023
* 06-08-Linux
* commit for merge
* Fix unit test
* format
* clean code
Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
* fix argument type
* while run external, convert list argument to str
* fix argument converting logic
* using parse_list_expression instead of parse_full_cell_path
* make parsing logic more explicit
* revert changes
* add tests
* Fix `ls` for Windows system files
* Fix non-Windows builds
* Make Clippy happy on non-Windows platforms
* Fix new test on GitHub runners
* Move ls Windows code into its own module
Added CMD_FINISHED_MARKER to be emitted when command finishes.
Also switched the names PRE_EXECUTE_MARKER and PRE_PROMPT_MARKER
as the old names were confusing/wrong.
* Fix <table> output of 'to html',
Specifically, add <thead> and <tbody> elements.
That allows for better styling and (future) some neat JavaScript.
* Update tests for previous <table> changes.
* change between lazy and eager
* when expressions
* examples for aggregations
* more examples for agg
* examples for dataframes
* checked examples
* cargo fmt
* attemps to add '-o' flag to `fetch`
* fmt
* changed from 'output' to 'file'.
* Revert "changed from 'output' to 'file'."
As @hustcer mentioned, all typical command line tools for downloading
use `-o` or `-O` and a variation on `--output` for the file
This reverts commit 6baf718f91.
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
* Differentiate internal signature from external signature w.r.t. help
* Add in the --help flag to default externs in default config
* Remove unusued build_extern
Co-authored-by: mjclements <clements.michael.james@gmail.com>
* Add search terms for `all?`
JavaScript has `Array.every` similar to `all?`
* Add search terms for `any?`
JavaScript has `Array.some` similar to `any?`
* Add search terms for `length`
Count, `len()`, and `size`/`sizeof` in widely-known programming languages are equivalent to `length`
* Add search terms for `keybindings`
Shortcut and hotkey are common synonyms (especially in web and GUI land) for keybindings.
* Ignore `cargo tarpaulin` output files
* Add expected result for `columns` example
Examples without provided expected output will never be tested.
The subset of commands available in `test_examples()` is limited thus
excluding the tests depending on other commands
* Add example test harness to `reject`
* Test and fix `wrap` example
* Test and fix `drop column` example
* Update `from ods` examples
* Update `from xlsx` examples
* Run `to nuon` examples
* Run `hash base64` examples
* Add example output to `path parse`
* Test and fix the `grid` examples
* cp with no dangling link
* add -p to not follow symbolic link
* change comment
* add one more test case to check symblink body after copied
* better help message
* a more helpful error for let in pipeline
* a more helpful error for let in pipeline fmt
* changed help message
* type-o
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
* Allow env vars to be kept from removed overlay
* Rename --keep to --keep-custom; Add new test
* Rename some symbols
* (WIP) Start working on --keep for defs and aliases
* Fix decls/aliases not melting properly
* Use id instead of the whole cloned overlay
* Rewrite overlay remove for no reason
Doesn't fix the bug but at least looks better.
* Rename variable
* Fix adding overlay env vars
* Add more tests; Fmt + Clippy
Release notes: https://github.com/nushell/reedline/releases/tag/v0.6.0
This release contains several bug fixes and improvements to the vi-emulation and documentation.
- Improvements to the vi-style keybindings (@sadmac7000):
- `w` now correctly moves to the beginning of the word.
- `e` to move to the end of the word.
- Bugfixes:
- Support terminal emulators that erroneously report a size of 0x0 by assuming a default size to avoid panics and draw nevertheless (@DhruvDh)
- Fix `ListMenu` layout calculations. Avoids scrolling bug when wrapping occurs due to the line numbering (@ahkrr)
- Avoid allocating to the total history capacity which can cause the application to go out of memory (@sholderbach)
- Documentation improvements including addition of documentation intended for reedline developers (@petrisch, @sholderbach)
Schema `0o[77]` with the same padding behavior as the other binary literals
- this updates #5551
- test for parsing binary from octal
- test for string parsing
* allow for test_iteration_errors to work when run as root
* Add comment to skip condition
Co-authored-by: Stefan Holderbach <sholderbach@users.noreply.github.com>
* Cleanup - remove old commented code
* Force a / or \ to distinguish between folders and files for cp
* Force a / or \ to distinguish between folders and files for cp
* Remove unneeded code
* Add cp test for checking copy to non existing directory
* Fix warning in test
* Refer to the span of `error make` if not given
Implements #5591
Currently the span of the "throwing" `error make`
Also allow to set `msg` and `label` without an additional span.
* Message plus "originates from here" label
Fixes#5593 (OOM introduced with #5587 when no config was present and an attempt was
made to allocate all memory in advance)
Includes also other changes to reedline:
- Vi word definition fixed and `w` and `e` work as expected
* only set cwd for child process if cwd exists, and avoid showing error when pwd is not exists
* better comment text
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
* Change miette theme based on ANSI config
Use the base ansi colors to simplify the use of the terminal emulator
theming.
Turn of most eye-candy (including unicode) when using
`$config.use_ansi_coloring: false`
Addresses #5582
* Fix error test affected by changed styling
Currently the fully fledged help menu is bound to `Ctrl-Q`.
Help is widely associated with `F1`.
Before merging check that it is passed through on all platforms and
terminal emulators
* one step closer to flatten
* integration code is passing, but still need to do one more level flatten for table
* fix flatten
* using match instead of several if let
* make better comment
* fmt code
* better comment