RHash icon indicating copy to clipboard operation
RHash copied to clipboard

Format parameter for dirname

Open forthrin opened this issue 3 years ago • 2 comments

Thanks for a very useful utility!

Could you add a format parameter for file dirname?

I was expecting -p "%p" to contain the dirname only, so one is free to print dirname and filename jointly or separately.

%p/%f
%p\t%f

A format parameter for file extension would also be very nice to have.

forthrin avatar Sep 01 '22 06:09 forthrin

The '%d' directive for dirname is now supported by commit b41c17cff7e79c4ba855d76a3f75c07dbfe0a580.

rhash avatar Sep 14 '22 08:09 rhash

Works for me as expected. Very nice! Thank you! Please post a comment here if you decide to include a parameter for:

  • File extension

If you do, let the parameter return an empty string for 1) files starting with a dot and 2) files without a dot. In other words, return only "real" file extensions. Example:

foo.txt -> txt
.bashrc -> (empty string)
foobars -> (empty string)

This would be very beneficial and time saving! Thanks again!

forthrin avatar Sep 14 '22 10:09 forthrin