From d272aeb6ff0658d398e85af93aa6ae892ce49860 Mon Sep 17 00:00:00 2001 From: Chen Asraf Date: Wed, 4 Sep 2024 02:58:00 +0300 Subject: [PATCH] docs: update root-path description --- README.md | 21 ++++++++++++++++----- describe.go | 3 ++- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 845d3e7..7ea5747 100644 --- a/README.md +++ b/README.md @@ -22,39 +22,45 @@ Prints a tree-like representation of the input. - `-c, --charset CHARSET`: Use CHARSET to display characters (utf-8, ascii). - `-s, --trailing-slash`: Display trailing slash on directory. - `-p, --full-path`: Display full path. -- `-r, --root-path`: Replace root with given path. Default: "." +- `-r, --root-path PATH`: Use PATH to change the name of the root node (default: `.`). N/A if `--no-root-dot` is enabled. - `-D, --no-root-dot`: Do not display a root element. ## Installation ### Homebrew -1. Install via Homebrew: +Install via Homebrew: + ```sh brew tap chenasraf/tap brew install treelike ``` -### From Releases +### Direct Download -1. Go to the [Releases](https://github.com/chenasraf/treelike/releases) page. +1. Go to the [Latest Release](https://github.com/chenasraf/treelike/releases/latest) page. -2. Download the appropriate binary for your platform: +2. Download the appropriate binary archive for your platform: - **Windows**: `treelike-windows-amd64.tar.gz` - **macOS**: `treelike-darwin-amd64.tar.gz` - **Linux**: `treelike-linux-amd64.tar.gz` 3. Extract the tar: + ```sh tar -xzf treelike-darwin-amd64.tar.gz # macOS tar -xzf treelike-linux-amd64.tar.gz # Linux ``` + 4. Make the binary executable (if necessary): + ```sh chmod +x treelike ``` + 5. Move the binary to a directory in your PATH: + ```sh mv treelike /usr/local/bin/treelike ``` @@ -62,14 +68,19 @@ Prints a tree-like representation of the input. ### From Source 1. Clone the repository: + ```sh git clone https://github.com/chenasraf/treelike.git ``` + 2. Navigate to the project directory: + ```sh cd treelike ``` + 3. Build the project: + ```sh go build -o treelike treelike.go ``` diff --git a/describe.go b/describe.go index 753a7c0..15c7316 100644 --- a/describe.go +++ b/describe.go @@ -25,7 +25,8 @@ func helpText() strings.Builder { builder.WriteString(" -c, --charset CHARSET Use CHARSET to display characters (utf-8, ascii)" + LE) builder.WriteString(" -s, --trailing-slash Display trailing slash on directory" + LE) builder.WriteString(" -p, --full-path Display full path" + LE) - builder.WriteString(" -r, --root-path Replace root with given path. Default: \".\"" + LE) + builder.WriteString(" -r, --root-path Use PATH to change the name of the root node (default: .)" + LE) + builder.WriteString(" N/A if `--no-root-dot` is enabled" + LE) builder.WriteString(" -D, --no-root-dot Do not display a root element" + LE) return builder }