From c75e2e7140e5547778106b4801648e543f037faf Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 26 Jun 2019 17:32:10 +0900 Subject: encrypt: Add download filename option --- encrypt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}') -- cgit