Using the `*` wildcard should not attempt to delete files with a leading dot
unless the more explicit `.*` is used. `rm *` should also not attempt to delete
the current directory or its parent directory (`.` and `..`). I have resolved
this bug as well in a less satisfactory way. I think it may be the case that we
can only disambiguate the `.` and `..` path segments by using `Path::display`.
Here is a short list of alternatives that I tried:
- `Path::ends_with()` can detect `/..` but not `/.`.
- `Path::iter()` and `Path::components()` leave out `/.`.
- `Path::file_name()` normalizes `/.` to the parent component's file name.
Fixes#3508
* Fix parser expanding dots where it shouldn't
Previously, the parser would expand "a...b" as "a../..b". Now, >2 dots
are only expanded when the whole path component consists of dots (i.e.,
"..." expands to "../.." while "a...b" stays as it is).
* Respect OS separator when expanding >2 dots
"..." now expands to either "../.." or "..\..", based on the host OS.
* Add the load-env command
load-env can be used to add environment variables dynamically via an
InputStream. This allows developers to create tools that output environment
variables as key-value pairs, then have the user load those variables in using
load-env. This supplants most of the need for an `eval` command, which is
mostly used in POSIX envs for setting env vars.
Fixes#3481
* fixup! Add the load-env command
Not all lite command's first part denotes a real command (for cases like sub commands that it's second lite part accounts for the command name). This is important so that we can refer to it's span correctly. Here we fix to include the command's name span correctly whether it's a command or sub command when reporting missing flag errors.
* Allow querying the current path separator
* Convert char command to engine-p
* Wrap char args into struct
* Add --list option to char command
This lists all the available character names, along with the character
and its unicode points.
* commands to engine
* Correction of error in parser
* Added detailed regex error to parse
* better regex error parsing
* clippy corrections
* parse example with test
* secondary error for regex
* removed clone in error parser
* Secondary error message
The `date utc` command was removed in this PR:
https://github.com/nushell/nushell/pull/2780
The file was left but is no longer referenced from the parent module
and was not used.
Co-authored-by: Henrik Sjööh <henrik.sjooh@configura.com>