From de3060ffafdb0d64433411be374c36580519b2a6 Mon Sep 17 00:00:00 2001 From: Adam Eury Date: Mon, 2 Sep 2024 15:45:22 -0400 Subject: [PATCH] Rename crate --- Cargo.lock | 20 ++++++++++---------- Cargo.toml | 8 ++++---- README.md | 20 ++++++++++---------- src/main.rs | 2 +- tests/cli.rs | 16 ++++++++-------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 786d4b4..e4b6f2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,16 +161,6 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" -[[package]] -name = "dstats" -version = "0.1.4" -dependencies = [ - "assert_cmd", - "clap", - "predicates", - "spinoff", -] - [[package]] name = "float-cmp" version = "0.9.0" @@ -334,6 +324,16 @@ dependencies = [ "syn", ] +[[package]] +name = "spacehog" +version = "0.1.4" +dependencies = [ + "assert_cmd", + "clap", + "predicates", + "spinoff", +] + [[package]] name = "spinoff" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 3779c1c..303fbe0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "dstats" +name = "spacehog" version = "0.1.4" authors = ["Adam Eury "] edition = "2021" @@ -8,9 +8,9 @@ keywords = ["disk", "space", "usage", "large", "files"] categories = ["command-line-utilities"] license = "MIT OR Apache-2.0" readme = "README.md" -documentation = "https://docs.rs/dstats" -homepage = "https://github.com/aleury/dstats" -repository = "https://github.com/aleury/dstats" +documentation = "https://docs.rs/spacehog" +homepage = "https://github.com/aleury/spacehog" +repository = "https://github.com/aleury/spacehog" exclude = ["/.github/"] [dependencies] diff --git a/README.md b/README.md index dd2507a..8178b9b 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -[![CI](https://github.com/aleury/dstats/actions/workflows/ci.yml/badge.svg)](https://github.com/aleury/dstats/actions/workflows/ci.yml) -[![Nightly](https://github.com/aleury/dstats/actions/workflows/nightly.yml/badge.svg)](https://github.com/aleury/dstats/actions/workflows/nightly.yml) -[![Audit](https://github.com/aleury/dstats/actions/workflows/audit.yml/badge.svg)](https://github.com/aleury/dstats/actions/workflows/audit.yml) +[![CI](https://github.com/aleury/spacehog/actions/workflows/ci.yml/badge.svg)](https://github.com/aleury/spacehog/actions/workflows/ci.yml) +[![Nightly](https://github.com/aleury/spacehog/actions/workflows/nightly.yml/badge.svg)](https://github.com/aleury/spacehog/actions/workflows/nightly.yml) +[![Audit](https://github.com/aleury/spacehog/actions/workflows/audit.yml/badge.svg)](https://github.com/aleury/spacehog/actions/workflows/audit.yml) # Install with Cargo ``` -$ cargo install dstats +$ cargo install spacehog ``` # Build from source ``` -$ git clone git@github.com:aleury/dstats.git +$ git clone git@github.com:aleury/spacehog.git -$ cd dstats +$ cd spacehog $ cargo install --path . ``` @@ -23,7 +23,7 @@ $ cargo install --path . ``` A simple utility for finding large files on your system. -Usage: dstats [OPTIONS] [PATH] +Usage: spacehog [OPTIONS] [PATH] Arguments: [PATH] [default: .] @@ -38,11 +38,11 @@ Options: ```sh # View the top 5 largest files under the current directory -$ dstats +$ spacehog # View the top 10 largest files under the current directory -$ dstats -n 10 +$ spacehog -n 10 # View the top 10 largest files under the given path -$ dstats ./stuff -n 10 +$ spacehog ./stuff -n 10 ``` diff --git a/src/main.rs b/src/main.rs index d773b8c..4383370 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,7 +15,7 @@ fn main() { let args = Args::parse(); let mut sp = Spinner::new(spinners::Dots, "Scanning files...", Color::Blue); - let results = dstats::find_top_n_largest_files(&args.path, args.number); + let results = spacehog::find_top_n_largest_files(&args.path, args.number); sp.clear(); match results { diff --git a/tests/cli.rs b/tests/cli.rs index cd53d63..41a6413 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -2,7 +2,7 @@ use assert_cmd::Command; #[test] fn binary_with_version_flag_prints_version() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .arg("--version") .assert() @@ -12,7 +12,7 @@ fn binary_with_version_flag_prints_version() { #[test] fn binary_with_help_flag_prints_description() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .arg("--help") .assert() @@ -22,17 +22,17 @@ fn binary_with_help_flag_prints_description() { #[test] fn binary_with_help_flag_prints_usage() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .arg("--help") .assert() .success() - .stdout(predicates::str::contains("Usage: dstats")); + .stdout(predicates::str::contains("Usage: spacehog")); } #[test] fn binary_with_no_args_prints_top_5_largest_files_under_working_directory() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .assert() .success() @@ -48,7 +48,7 @@ fn binary_with_path_arg_prints_the_top_5_largest_files_under_the_given_path() { "6 B ./testdata/en/hello.txt", "5 B ./testdata/es/hola.txt", ]; - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .arg("./testdata") .assert() @@ -58,7 +58,7 @@ fn binary_with_path_arg_prints_the_top_5_largest_files_under_the_given_path() { #[test] fn binary_with_the_number_arg_prints_the_top_n_largest_files_under_the_current_working_directory() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .args(["-n", "10"]) .assert() @@ -68,7 +68,7 @@ fn binary_with_the_number_arg_prints_the_top_n_largest_files_under_the_current_w #[test] fn binary_with_invalid_path_arg_prints_an_error_message_and_exits_with_failure_code() { - Command::cargo_bin("dstats") + Command::cargo_bin("spacehog") .unwrap() .arg("nonexistent") .assert()