Skip to content
Myr

Make the path-separator check Windows-only

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Peter · committed by David Peter · parent 515e0ee · Browse files · 1 file+11 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−8 removed

  • other:+11 added−8 removed

1 file+11 added−8 removed

modified:src/main.rs+11 added-8 removed
175 unmodified lines
176 let path_separator = matches177 .value_of("path-separator")178 .map_or_else(filesystem::default_path_separator, |s| Some(s.to_owned()));179180 #[cfg(windows)]181 {180 if let Some(ref sep) = path_separator {181 if sep.len() > 1 {182 return Err(anyhow!(183 "A path separator must be exactly one byte, but \182 if let Some(ref sep) = path_separator {183 if sep.len() > 1 {184 return Err(anyhow!(185 "A path separator must be exactly one byte, but \186 the given separator is {} bytes: '{}'.\n\187 In some shells on Windows, '/' is automatically \188 expanded. Try to use '//' instead.",187 sep.len(),188 sep189 ));189 sep.len(),190 sep191 ));192 };193 };191 };194 }195196 let ls_colors = if colored_output {197 Some(LsColors::from_env().unwrap_or_else(|| LsColors::from_string(DEFAULT_LS_COLORS)))198 } else {
292 unmodified lines