nushell/crates
Wind 87c5f6e455
ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232)
# Description
Fixes:  #11887
Fixes: #11626

This pr unify the tilde expand behavior over several filesystem relative
commands. It follows the same rule with glob expansion:
|  command  |  result |
| ----------- |  ------ |
| ls ~/aaa  | expand tilde
| ls "~/aaa"  | don't expand tilde
| let f = "~/aaa"; ls $f | don't expand tilde, if you want to: use `ls
($f \| path expand)`
| let f: glob = "~/aaa"; ls $f | expand tilde, they don't expand on
`mkdir`, `touch` comamnd.

Actually I'm not sure for 4th item, currently it's expanding is just
because it followes the same rule with glob expansion.

### About the change
It changes `expand_path_with` to accept a new argument called
`expand_tilde`, if it's true, expand it, if not, just keep it as `~`
itself.

# User-Facing Changes
After this change, `ls "~/aaa"` won't expand tilde.

# Tests + Formatting
Done
2024-03-25 10:08:38 +08:00
..
nu-cli ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-cmd-base Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-cmd-dataframe Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-cmd-extra Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-cmd-lang Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-color-config Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-command ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-engine ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-explore Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-glob Fix ignored clippy lints (#12160) 2024-03-11 19:46:04 +01:00
nu-json Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-lsp Send LSP Completion Item Kind (#11443) 2024-03-24 20:14:12 -05:00
nu-parser Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-path ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-plugin Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-plugin-test-support Add test support crate for plugin developers (#12259) 2024-03-23 13:29:54 -05:00
nu-pretty-hex nu-explore/ Use hex-dump for binary data (#12184) 2024-03-21 19:02:03 -05:00
nu-protocol ls, rm, cp, open, touch, mkdir: Don't expand tilde if input path is quoted string or a variable. (#12232) 2024-03-25 10:08:38 +08:00
nu-std to json -r not removing whitespaces fix (#11948) 2024-03-20 22:14:31 +01:00
nu-system Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-table Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-term-grid Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-test-support Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu-utils Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu_plugin_custom_values Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu_plugin_example Support for getting help text from a plugin command (#12243) 2024-03-24 07:30:38 +08:00
nu_plugin_formats Move more dependencies to workspace level (#12270) 2024-03-23 18:46:02 -05:00
nu_plugin_gstat Better generic errors for plugins (and perhaps scripts) (#12236) 2024-03-21 12:27:21 +01:00
nu_plugin_inc Better generic errors for plugins (and perhaps scripts) (#12236) 2024-03-21 12:27:21 +01:00
nu_plugin_python Improve the error message for a plugin version mismatch (#12122) 2024-03-08 06:04:22 -06:00
nu_plugin_query Support for getting help text from a plugin command (#12243) 2024-03-24 07:30:38 +08:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

Nushell core libraries and plugins

These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.

Foundational libraries are split into two kinds of crates:

  • Core crates - those crates that work together to build the Nushell language engine
  • Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.

Plugins are likewise also split into two types:

  • Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
  • Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.