-
-
Save mrahtz/cbedff5aff76a53875407e70e9e399db to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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