1 unstable release
Uses old Rust 2015
| 0.3.0 | Sep 3, 2016 |
|---|
#53 in #was
17KB
408 lines
rrun
Remote run utility; runs a command via SSH if the current directory was mounted via SSHFS. You may freely use and modify this code under the CC0 1.0 Universal License.
Usage
Run command remotely:
rrun [COMMAND [ARGS...]]
Get currently mounted host and directory:
rpwd
For more formal documentation, you can find the rustdoc here.
Installation
Requires Rust 1.9 to build. Install with:
cargo build --release
install -m755 target/release/rrun /usr/bin/rrun
install -m755 target/release/rpwd /usr/bin/rpwd
lib.rs:
The command-line tool works in the following order:
RemoteMounts::loadis called to load the contents of/etc/mtabinto an internal struct.RemoteMounts::into_current_diris called to convert the above into aLocation.Location::into_env_argsis called to convert the above intoProgramArgs.ProgramArgs::into_commandis called to convert the above intostd::process::Command.
For rpwd, only steps 1 and 2 are run, and the resulting Location is printed.