Skip to content

Instantly share code, notes, and snippets.

@mrahtz
Created March 9, 2019 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrahtz/cbedff5aff76a53875407e70e9e399db to your computer and use it in GitHub Desktop.
Save mrahtz/cbedff5aff76a53875407e70e9e399db to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
import argparse
import fileinput
import os
import socket
import sys
parser = argparse.ArgumentParser()
parser.add_argument('files', nargs='*')
args = parser.parse_args()
if args.files:
files = args.files
else:
files = []
for line in fileinput.input():
files.append(line.strip())
paths = []
for f in files:
if not os.path.exists(f):
print(f"Error: path '{f}' does not exist", file=sys.stderr)
exit(1)
paths.append(os.path.realpath(f))
print(f"rtransfer {socket.gethostname()} " + " ".join(paths))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment