Crates.io | pathmut |
lib.rs | pathmut |
version | 0.3.0 |
source | src |
created_at | 2022-12-02 22:29:41.760667 |
updated_at | 2022-12-05 22:31:24.854277 |
description | Command line utility for extracting, removing, and replacing components from path strings |
homepage | |
repository | https://github.com/rutrum/pathmut |
max_upload_size | |
id | 728665 |
size | 33,971 |
pathmut
is a path string manipulation utilityThis was made because I'm tired of resorting to basename
, dirname
, cut -d. -f1
or whatever other random core util to just extract some information from path names.
Important to know this utility only works with path strings and doesn't touch the file system whatsoever.
$ pathmut
Mutates path strings.
Usage: pathmut [COMPONENT|COMMAND]
Components/Commands:
ext Read or update file extension
stem Read or update file stem
prefix Read or update file prefix
name Read or update file name
parent Read or update parent directory
first Read or update first component
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help information
-V, --version Print version information
This utility is really just a command line wrapper for Rust's Path struct API. Precise details on exactly how these commands work are found there.
first
command--remove
and --replace
arguments for every commandrmext
commandrmext
commandext
, stem
, prefix
, name
, parent
commands.