Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename crate #17

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "dstats"
name = "spacehog"
version = "0.1.4"
authors = ["Adam Eury <[email protected]>"]
edition = "2021"
Expand All @@ -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]
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 [email protected]:aleury/dstats.git
$ git clone [email protected]:aleury/spacehog.git

$ cd dstats
$ cd spacehog

$ cargo install --path .
```
Expand All @@ -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: .]
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
16 changes: 8 additions & 8 deletions tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down