|0.1.3||Oct 19, 2020|
|0.1.2||Jun 21, 2020|
|0.1.1||Jun 19, 2020|
|0.1.0||Jun 19, 2020|
#1400 in Filesystem
sp (Single Path)
This cli was made because at work we use some shared drives. The OS usage in the company is split between Windows and Linux in favor of Windows. Because most people use Windows we share links to files like this:
If you are using linux opening these paths and linking them is a headache because we have paths like this:
This cli opens files from Windows paths and translates Linux paths to Windows paths. It should work for Windows users with Linux paths, but I never tried.
This cli was made using the Rust programming language, so you will need Rust to use it.
$ cargo install sp
You can check the usage with these commands:
$ sp -h $ sp --help
First you need to set some replace pairs to translate Windows to Linux.
$ sp -f 'p:\' -r '/mnt/public/' $ sp --find 't:\' --replace '/mnt/temp/'
You can list the replace pairs with these commands:
$ sp -l $ sp --list
To clear the replace pairs you run one of these:
$ sp -e $ sp --empty
For opening files we use these commands:
$ sp -o 't:\igor\path\sccpre.cat-kim-jung-un-png-913514.png' $ sp --open 't:\igor\path\sccpre.cat-kim-jung-un-png-913514.png'
To translate a path to Windows and copy it to the clipboard you can do this:
$ sp -t /mnt/temp/igor/path/sccpre.cat-kim-jung-un-png-913514.png $ sp --translate /mnt/temp/igor/path/sccpre.cat-kim-jung-un-png-913514.png