nushell/crates/nu-command/src
Devyn Cairns 43e349a274
Mitigate the poor interaction between ndots expansion and non-path strings (#13218)
# Description

@hustcer reported that slashes were disappearing from external args
since #13089:

```
$> ossutil ls oss://abc/b/c
Error: invalid cloud url: "oss:/abc/b/c", please make sure the url starts with: "oss://"

$> ossutil ls 'oss://abc/b/c'
Error: oss: service returned error: StatusCode=403, ErrorCode=UserDisable, ErrorMessage="UserDisable", RequestId=66791EDEFE87B73537120838, Ec=0003-00000801, Bucket=abc, Object=
```

I narrowed this down to the ndots handling, since that does path parsing
and path reconstruction in every case. I decided to change that so that
it only activates if the string contains at least `...`, since that
would be the minimum trigger for ndots, and also to not activate it if
the string contains `://`, since it's probably undesirable for a URL.

Kind of a hack, but I'm not really sure how else we decide whether
someone wants ndots or not.

# User-Facing Changes
- bare strings not containing ndots are not modified
- bare strings containing `://` are not modified

# Tests + Formatting
Added tests to prevent regression.
2024-06-24 16:39:01 -07:00
..
bytes Improves commands that support range input (#13113) 2024-06-18 07:19:13 -05:00
charting Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
conversions Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
database Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
date Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
debug Small improvements to debug profile (#12930) 2024-05-22 19:56:51 +03:00
env Remove list support in with-env (#12939) 2024-05-23 13:53:55 +08:00
experimental Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
filesystem Fixes #13093 - Erroneous example in 'touch' help (#13095) 2024-06-07 09:33:48 -05:00
filters Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00
formats Use native toml datetime type in to toml (#13018) 2024-06-07 07:43:30 -05:00
generators Suppress column index for default cal output (#13188) 2024-06-22 07:41:29 -05:00
hash Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
help Fix display formatting for command type in help commands (#12996) 2024-06-07 08:03:31 -05:00
math Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
misc Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
network Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
path path type error and not found changes (#13007) 2024-06-11 05:40:09 +08:00
platform Add Span merging functions (#12511) 2024-05-16 22:34:49 +00:00
random Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
removed Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
shells Add command_prelude module (#12291) 2024-03-26 21:17:30 +00:00
stor Allow stor insert and stor update to accept pipeline input (#12882) 2024-06-06 10:30:06 -05:00
strings Improves commands that support range input (#13113) 2024-06-18 07:19:13 -05:00
system Mitigate the poor interaction between ndots expansion and non-path strings (#13218) 2024-06-24 16:39:01 -07:00
viewers Table help rendering (#13182) 2024-06-19 20:12:25 -05:00
default_context.rs Make which-support feature non-optional (#13125) 2024-06-12 20:04:12 -05:00
example_test.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
lib.rs Initial --params implementation (#12249) 2024-03-24 15:40:21 -05:00
progress_bar.rs Replace ExternalStream with new ByteStream type (#12774) 2024-05-16 07:11:18 -07:00
sort_utils.rs Add derive macros for FromValue and IntoValue to ease the use of Values in Rust code (#13031) 2024-06-17 16:05:11 -07:00