Updated help menu to be more consistent
This commit is contained in:
parent
7bab8a9436
commit
f4d9c37687
@ -54,7 +54,7 @@ def rename(
|
|||||||
logging.warning(
|
logging.warning(
|
||||||
'Group "%s" was not matched to any row in the provided CSV. '
|
'Group "%s" was not matched to any row in the provided CSV. '
|
||||||
"Skipping...",
|
"Skipping...",
|
||||||
match.group(1)
|
match.group(1),
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
original = subitem_path
|
original = subitem_path
|
||||||
@ -87,31 +87,31 @@ def run(args):
|
|||||||
def main():
|
def main():
|
||||||
program_name = "renamebycsv"
|
program_name = "renamebycsv"
|
||||||
argparser = argparse.ArgumentParser(
|
argparser = argparse.ArgumentParser(
|
||||||
program_name, "Rename all files by using a CSV as a dictionary."
|
program_name, description="Rename all files by using a CSV as a dictionary."
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"input_dir",
|
"input_dir",
|
||||||
help="The directory containing the items that is to be renamed.",
|
help="The directory containing the items that is to be renamed",
|
||||||
metavar="I",
|
metavar="I",
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"regex",
|
"regex",
|
||||||
help="The regex to apply to each file name. The first capture group is used to "
|
help="The regex to apply to each file name. The first capture group is used to "
|
||||||
"perform the replacement.",
|
"perform the replacement",
|
||||||
metavar="R",
|
metavar="R",
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"csv",
|
"csv",
|
||||||
help="The CSV to use as the dictionary for the substitutions in file name.",
|
help="The CSV to use as the dictionary for the substitutions in file name",
|
||||||
metavar="C",
|
metavar="C",
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"current",
|
"current",
|
||||||
help="The column header to look for the text matched by the regex.",
|
help="The column header to look for the text matched by the regex",
|
||||||
metavar="F",
|
metavar="F",
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"become", help="The column header to replace the regex match.", metavar="T"
|
"become", help="The column header to replace the regex match", metavar="T"
|
||||||
)
|
)
|
||||||
argparser.add_argument(
|
argparser.add_argument(
|
||||||
"-r",
|
"-r",
|
||||||
@ -140,7 +140,7 @@ def main():
|
|||||||
"-k",
|
"-k",
|
||||||
"--keep-extension",
|
"--keep-extension",
|
||||||
help="Keeps the original file's extension by appending it to the end of the "
|
help="Keeps the original file's extension by appending it to the end of the "
|
||||||
"name defined by the CSV.",
|
"name defined by the CSV",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user