Crates.io | sp |
lib.rs | sp |
version | 0.1.3 |
source | src |
created_at | 2020-06-19 11:27:56.875493 |
updated_at | 2020-10-19 21:59:13.139869 |
description | This cli opens files from Windows paths and translates Linux paths to Windows paths. |
homepage | |
repository | https://github.com/ivkovici/sp |
max_upload_size | |
id | 255661 |
size | 32,050 |
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:
t:\igor\path\sccpre.cat-kim-jung-un-png-913514.png
If you are using linux opening these paths and linking them is a headache because we have paths like this:
/mnt/temp/igor/path/sccpre.cat-kim-jung-un-png-913514.png
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