working help, and checking existing files
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user