sp

Crates.iosp
lib.rssp
version0.1.3
sourcesrc
created_at2020-06-19 11:27:56.875493
updated_at2020-10-19 21:59:13.139869
descriptionThis cli opens files from Windows paths and translates Linux paths to Windows paths.
homepage
repositoryhttps://github.com/ivkovici/sp
max_upload_size
id255661
size32,050
Igor Ivkovic (ivkovici)

documentation

https://github.com/ivkovici/sp

README

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:

 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.

Dependencies

This cli was made using the Rust programming language, so you will need Rust to use it.

INSTALL RUST

Installation

$ cargo install sp

Usage

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
Commit count: 16

cargo fmt