Skip to content

Commit

Permalink
[#16] feat: add examples and help output
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelmmiguel committed Feb 28, 2022
1 parent e2fbf39 commit 669ef90
Showing 1 changed file with 57 additions and 8 deletions.
65 changes: 57 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,86 @@
# fu
A du replacement with more features

`fu` is a `du` alike CLI. It comes with a set a new features and a better output. For example, it allows you to sort and limit the number of entries and provides a colorized output to highlight heaviest entries.

## Installation

TODO
_TODO_

## Usage

```
fu --help
$ fu --help
fu
Search for a pattern in a file and display the lines that contain it
USAGE:
fu [OPTIONS] <PATH>
ARGS:
<PATH> The path to the file to read
OPTIONS:
-h, --help Print help information
--no-colors Disable the colors in the output
--no-header Hide the headers from the output
-s, --sort Sort the output based on the size
-t, --top <TOP> Sort and limit the output to the N heaviest entries
```

### Sort the entries by size

```
fu --sort ./
$ fu --sort ./
DISK BYTES PATH
258M 238M target
492K 71K .git
12K 11K LICENSE
8K 6K Cargo.lock
12K 4K src
4K 1K README.md
4K 361B Cargo.toml
4K 263B .github
4K 131B .gitignore
```

### Just the sum of the folder

```
$ fu .
DISK BYTES PATH
259M 239M .
```

### Sort and show top N entries

```
fu --top 2 ./
$ fu --top 2 ./
DISK BYTES PATH
258M 238M target
492K 71K .git
```

### Use glob

```
fu ./*.md
$ fu ./*.md
DISK BYTES PATH
4K 1K ./README.md
```

### Hide headers

```
$ fu --top 2 --no-headers ./
258M 238M target
492K 71K .git
```

## Development

To develop `fu` you need to install the Rust language on your environment:

* [Get started with Rust](https://www.rust-lang.org/learn/get-started)
- [Get started with Rust](https://www.rust-lang.org/learn/get-started)

Then, you need to clone the project and start exploring the CLI:

Expand All @@ -49,6 +96,9 @@ cargo tests
# Build the CLI
cargo build
# Build using the release profile
cargo build --release
```

## Why?
Expand All @@ -63,4 +113,3 @@ That's all! Feel free to request new features and let's discuss about how we can
## License

`fu` is released under the Apache License v2.0 (See [LICENSE](https://github.com/Angelmmiguel/fu/blob/main/LICENSE)). Copyright 2022 [Angel M Miguel](https://angel.kiwi).

0 comments on commit 669ef90

Please sign in to comment.