Skip to content

Commit

Permalink
Improve README
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Jun 8, 2024
1 parent 742d7fa commit 73ad41a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 51 deletions.
96 changes: 96 additions & 0 deletions .github/images/usage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 1 addition & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
<img src=".github/images/usage.svg" />

### CI Status

Expand Down

0 comments on commit 73ad41a

Please sign in to comment.