Add --basename argument.

This commit is contained in:
voussoir 2021-01-31 10:08:24 -08:00
parent dd5a298614
commit 8edefba1ad
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -10,7 +10,11 @@ def backup_folder_argparse(args):
folder = pathclass.Path(args.folder)
folder.correct_case()
rar_name = f'{folder.basename} {date}'
if args.basename:
basename = args.basename.strip()
else:
basename = folder.basename
rar_name = f'{basename} {date}'
rarpar.rarpar(
path=folder,
@ -27,6 +31,7 @@ def main(argv):
parser.add_argument('folder')
parser.add_argument('destination_folder')
parser.add_argument('--basename', default=None)
parser.set_defaults(func=backup_folder_argparse)
args = parser.parse_args(argv)