There is basename
and dirname
, but not tool to get the file extension of a given file.
This is where extname
comes in.
extname
is a simple tool to work like basename
and dirname
, but provides the extension name of a file.
First, clone this git repository
git clone git@github.com:mimre25/extname.git
or
git clone https://github.com/mimre25/extname.git
Then, run
cargo build --release
to build the binaries.
Last, copy the binaries from target/release/extname
to some place on your path, or add target/release
to your path.
Nah, that's all.
Just wanted to solve this little problem for myself and explore rust
a bit on the way.