working help, and checking existing files

This commit is contained in:
q
2024-08-10 17:18:07 +03:00
parent f82e4d9913
commit 17cb614f24
3 changed files with 7 additions and 2 deletions

View File

@@ -64,7 +64,7 @@ def setup_options():
action="store",
dest="datefmt",
default=None,
help="Date format for 'date' split. Defaults to %Y-%m-%d",
help="Date format for 'date' split. Defaults to %%Y-%%m-%%d",
)
parser.add_argument(
"-n",
@@ -91,7 +91,7 @@ def setup_options():
action="store",
default=".",
nargs="?",
help="Folder to split.",
help="Folder to split. Defaults to current folder.",
)
options = parser.parse_args()
if options.regexp != "":
@@ -144,6 +144,9 @@ def linktree(src, dst):
def copyfileorfolder(basename, source, target, move):
"""Copies a file or folder structure under target folder"""
if os.path.exists(os.path.join(target, basename)):
print("FileExists!: " + os.path.join(target, basename))
return
if move:
shutil.move(os.path.join(source, basename), os.path.join(target, basename))
return