From 73ad41a8c978fd0f293e709d1017b464eef8d636 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sat, 8 Jun 2024 23:23:33 +0300 Subject: [PATCH] Improve README --- .github/images/usage.svg | 96 ++++++++++++++++++++++++++++++++++++++++ README.md | 52 +--------------------- 2 files changed, 97 insertions(+), 51 deletions(-) create mode 100644 .github/images/usage.svg diff --git a/.github/images/usage.svg b/.github/images/usage.svg new file mode 100644 index 0000000..8722b0c --- /dev/null +++ b/.github/images/usage.svg @@ -0,0 +1,96 @@ + + + + path Usage + + + + + + + + + + + + + + + + + + Terminal + Usage: path {options} {command} + Commands + base path ............... Strip directory and suffix from filenames + dir path ................ Strip last component from file name + dirn num path ........... Return N elements from path + link path ............... Print resolved symbolic links or canonical file names + clean path .............. Print shortest path name equivalent to path by purely lexical processing + compact path ............ Converts path to compact representation + abs path ................ Print absolute representation of path + ext path ................ Print file extension + match pattern path ...... Filter given path using pattern + join root path .......... Join path elements + add-prefix prefix path .. Add the substring at the beginning + del-prefix prefix path .. Remove the substring at the beginning + add-suffix suffix path .. Add the substring at the end + del-suffix suffix path .. Remove the substring at the end + exclude substr path ..... Exclude part of the string + is-abs path ............. Check if given path is absolute + is-local path ........... Check if given path is local + is-safe path ............ Check if given path is safe + is-match pattern path ... Check if given path is match to pattern + Options + --zero, -z ....... End each output line with NUL, not newline + --space, -s ...... End each output line with space, not newline + --quiet, -q ...... Suppress all error messages + --no-color, -nc .. Disable colors in output + --help, -h ....... Show this help message + --version, -v .... Show version + Examples + path base /path/to/file.txt + → file.txt + path dir /path/to/file.txt + → /path/to + path compact /very/long/path/to/some/file.txt + → /v/l/p/t/s/file.txt + ls -1 | path is-match '*.txt' && echo MATCH! + Check if all files in current directory is match to pattern + PATH_QUIET=1 path dir /path/to/file.txt + Run dir command in quiet mode enabled by environment variable + + + diff --git a/README.md b/README.md index 87e1f73..d09d6eb 100644 --- a/README.md +++ b/README.md @@ -110,57 +110,7 @@ path --generate-man | sudo gzip > /usr/share/man/man1/path.1.gz ### Usage -``` -Usage: path {options} {command} - -Commands - - base path Strip directory and suffix from filenames - dir path Strip last component from file name - dirn num path Return N elements from path - link path Print resolved symbolic links or canonical file names - clean path Print shortest path name equivalent to path by purely lexical processing - compact path Converts path to compact representation - abs path Print absolute representation of path - ext path Print file extension - match pattern path Filter given path using pattern - join root path Join path elements - add-prefix prefix path Add the substring at the beginning - del-prefix prefix path Remove the substring at the beginning - add-suffix suffix path Add the substring at the end - del-suffix suffix path Remove the substring at the end - exclude substr path Exclude part of the string - is-abs path Check if given path is absolute - is-local path Check if given path is local - is-safe path Check if given path is safe - is-match pattern path Check if given path is match to pattern - -Options - - --zero, -z End each output line with NUL, not newline - --space, -s End each output line with space, not newline - --quiet, -q Suppress all error messages - --no-color, -nc Disable colors in output - --help, -h Show this help message - --version, -v Show version - -Examples - - path base /path/to/file.txt - → file.txt - - path dir /path/to/file.txt - → /path/to - - path compact /very/long/path/to/some/file.txt - → /v/l/p/t/s/file.txt - - ls -1 | path is-match '*.txt' && echo MATCH! - Check if all files in current directory is match to pattern - - PATH_QUIET=1 path dir /path/to/file.txt - Run dir command in quiet mode enabled by environment variable -``` + ### CI Status