summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2019-06-26 17:32:10 +0900
committerjaseg <git@jaseg.net>2019-06-26 17:32:10 +0900
commitc75e2e7140e5547778106b4801648e543f037faf (patch)
tree6d054955bdaa0bfce569046d14766b2cbed2f538
parentbf86e740bd1f025af3158ffdaaa05c25d7a2a37a (diff)
downloadsecure-download-c75e2e7140e5547778106b4801648e543f037faf.tar.gz
secure-download-c75e2e7140e5547778106b4801648e543f037faf.tar.bz2
secure-download-c75e2e7140e5547778106b4801648e543f037faf.zip
encrypt: Add download filename option
-rw-r--r--encrypt.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/encrypt.py b/encrypt.py
index e13df79..d89d01c 100644
--- a/encrypt.py
+++ b/encrypt.py
@@ -14,6 +14,7 @@ if __name__ == '__main__':
parser.add_argument('infile')
parser.add_argument('-c', '--config', default=None, help='Config file location (default; $XDG_CONFIG_HOME/filecrypt.conf)')
parser.add_argument('-b', '--base-url', default=None, help='Base URL for link (also as config option)')
+ parser.add_argument('-f', '--filename', default=None, help='Download filename (default: Same as input filename)')
parser.add_argument('-q', '--no-progress', action='store_true', help='Hide progress bar')
parser.add_argument('-p', '--progress', action='store_true', help='Show progress bar (default, also as config option)')
args = parser.parse_args()
@@ -35,7 +36,7 @@ if __name__ == '__main__':
print(f'{infile} is not a file or directory, exiting.')
os.exit(2)
- download_filename = os.path.basename(args.infile)
+ download_filename = args.filename or os.path.basename(args.infile)
file_id, token, encrypt = generate_keys(download_filename)
print(f'{base_url}/{file_id}/{token}/{download_filename}')