Skip to content

Commit

Permalink
Merge branch 'master' into winget
Browse files Browse the repository at this point in the history
  • Loading branch information
kdpuvvadi authored Nov 17, 2023
2 parents 2ae0e16 + 5d857b5 commit 9a09007
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
PROJECT_NAME: lsd
PROJECT_DESC: "An ls command with a lot of pretty colors."
PROJECT_AUTH: "Peltoche <[email protected]>"
RUST_MIN_SRV: "1.64.0"
RUST_MIN_SRV: "1.69.0"

on: [push, pull_request]

Expand Down
111 changes: 83 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ once_cell = "1.17.1"
chrono = { version = "0.4.*", features = ["unstable-locales"] }
chrono-humanize = "0.1.*"
unicode-width = "0.1.*"
lscolors = "0.14.0"
lscolors = "0.15.0"
wild = "2.0.*"
globset = "0.4.*"
xdg = "2.1.*"
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
<div align="center">

<p>
<sup>
<a href="https://github.com/sponsors/zwpaper">LSD is supported by the community.</a>
</sup>
</p>
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://www.warp.dev/?utm_source=github&utm_medium=referral&utm_campaign=lsd_20231001">
<div>
<img src="https://user-images.githubusercontent.com/3764335/271887540-b782d11d-d122-484d-8cd3-7fdff3b4ac4d.png" width="230" alt="Warp">
</div>
<b>Warp is a blazingly fast, Rust-based terminal reimagined to work like a modern app.</b>
<div>
<sup>Get more done in the CLI with real text editing, block-based output, and AI command search.</sup>
</div>
</a>
<hr>
</div>


# LSD (LSDeluxe)

[![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg)](https://raw.githubusercontent.com/lsd-rs/lsd/master/LICENSE)
Expand Down
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ include!("src/app.rs");

fn main() {
// rustc version too small or can't figure it out
if version_check::is_min_version("1.64.0") != Some(true) {
eprintln!("'lsd' requires rustc >= 1.64.0");
if version_check::is_min_version("1.69.0") != Some(true) {
eprintln!("'lsd' requires rustc >= 1.69.0");
exit(1);
}

Expand Down
19 changes: 6 additions & 13 deletions src/flags/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@ impl Configurable<Self> for Literal {
/// Get a potential `Literal` value from [Cli].
///
/// If the "literal" argument is passed, this returns a `Literal` with value `true` in a
/// [Some]. Otherwise this returns `Literal` with value `false` in a [Some].
/// [Some]. Otherwise this returns [None].
fn from_cli(cli: &Cli) -> Option<Self> {
if cli.literal {
Some(Self(true))
} else {
Some(Self(false))
None
}
}

/// Get a potential `Literal` value from a [Config].
///
/// If the `Config::indicators` has value,
/// this returns its value as the value of the `Literal`, in a [Some].
/// Otherwise this returns `Literal` with value `false` in a [Some].
/// Otherwise this returns [None].
fn from_config(config: &Config) -> Option<Self> {
if let Some(value) = config.literal {
Some(Self(value))
} else {
Some(Self(false))
}
config.literal.map(Self)
}
}

Expand All @@ -51,7 +47,7 @@ mod test {
fn test_from_cli_none() {
let argv = ["lsd"];
let cli = Cli::try_parse_from(argv).unwrap();
assert_eq!(Some(Literal(false)), Literal::from_cli(&cli));
assert_eq!(None, Literal::from_cli(&cli));
}

#[test]
Expand All @@ -63,10 +59,7 @@ mod test {

#[test]
fn test_from_config_none() {
assert_eq!(
Some(Literal(false)),
Literal::from_config(&Config::with_none())
);
assert_eq!(None, Literal::from_config(&Config::with_none()));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/meta/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ mod tests {
// likely to fail because of permission issue
// see https://doc.rust-lang.org/std/os/windows/fs/fn.symlink_file.html
#[cfg(windows)]
std::os::windows::fs::symlink_file(&path_c, &path_b)
std::os::windows::fs::symlink_file(path_c, &path_b)
.expect("failed to create broken symlink");

let meta_b = Meta::from_path(&path_b, true, false).expect("failed to get meta");
Expand Down
2 changes: 1 addition & 1 deletion src/sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ mod tests {
// likely to fail because of permission issue
// see https://doc.rust-lang.org/std/os/windows/fs/fn.symlink_file.html
#[cfg(windows)]
std::os::windows::fs::symlink_file(&path_d, &path_c)
std::os::windows::fs::symlink_file(path_d, &path_c)
.expect("failed to create broken symlink");

let meta_c = Meta::from_path(&path_c, true, false).expect("failed to get meta");
Expand Down
2 changes: 1 addition & 1 deletion src/theme/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
}

/// A struct holding the theme configuration
/// Color table: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.avg
/// Color table: https://upload.wikimedia.org/wikipedia/commons/1/15/Xterm_256color_chart.svg
#[derive(Debug, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
#[serde(deny_unknown_fields)]
Expand Down
Loading

0 comments on commit 9a09007

Please sign in to comment.