From 669ef901d0d2f51bd8534c1ddf3107f504fa91e1 Mon Sep 17 00:00:00 2001 From: Angel M Date: Mon, 28 Feb 2022 16:00:54 +0100 Subject: [PATCH] [#16] feat: add examples and help output --- README.md | 65 ++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d24d731..9519334 100644 --- a/README.md +++ b/README.md @@ -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] + +ARGS: + 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 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: @@ -49,6 +96,9 @@ cargo tests # Build the CLI cargo build + +# Build using the release profile +cargo build --release ``` ## Why? @@ -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). -