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::load
is called to load the contents of/etc/mtab
into an internal struct.RemoteMounts::into_current_dir
is called to convert the above into aLocation
.Location::into_env_args
is called to convert the above intoProgramArgs
.ProgramArgs::into_command
is called to convert the above intostd::process::Command
.
For rpwd
, only steps 1 and 2 are run, and the resulting Location
is printed.