Code style changes
This commit is contained in:
parent
47d2d20043
commit
6225af0308
|
@ -15,50 +15,50 @@ DEFAULT_TIMESTAMP_FORMAT = "%Y%m%d"
|
||||||
# Argument parser
|
# Argument parser
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Cleanup old backups",
|
description="Cleanup old backups",
|
||||||
epilog = "For a complete timestamp format description, see the python strftime() " +
|
epilog="For a complete timestamp format description, see the python strftime() " +
|
||||||
"documentation: https://docs.python.org/3/library/datetime.html" +
|
"documentation: https://docs.python.org/3/library/datetime.html" +
|
||||||
"#strftime-strptime-behavior"
|
"#strftime-strptime-behavior"
|
||||||
)
|
)
|
||||||
# path argument
|
# path argument
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"path",
|
"path",
|
||||||
metavar = "PATH",
|
metavar="PATH",
|
||||||
type = str,
|
type=str,
|
||||||
nargs = 1,
|
nargs=1,
|
||||||
help = "directory path"
|
help="directory path"
|
||||||
)
|
)
|
||||||
# number of files
|
# number of files
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-n", "--number-of-files",
|
"-n", "--number-of-files",
|
||||||
type = int,
|
type=int,
|
||||||
default = DEFAULT_NUMBER_OF_FILES,
|
default=DEFAULT_NUMBER_OF_FILES,
|
||||||
metavar = "N",
|
metavar="N",
|
||||||
help = f"generate N files, default: {DEFAULT_NUMBER_OF_FILES}"
|
help=f"generate N files, default: {DEFAULT_NUMBER_OF_FILES}"
|
||||||
)
|
)
|
||||||
# prefix argument
|
# prefix argument
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-p", "--prefix",
|
"-p", "--prefix",
|
||||||
type = str,
|
type=str,
|
||||||
default = DEFAULT_PREFIX,
|
default=DEFAULT_PREFIX,
|
||||||
metavar = "PREFIX",
|
metavar="PREFIX",
|
||||||
help = f"use PREFIX as file name prefix, default: {DEFAULT_PREFIX}"
|
help=f"use PREFIX as file name prefix, default: {DEFAULT_PREFIX}"
|
||||||
)
|
)
|
||||||
# suffix argument
|
# suffix argument
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-s", "--suffix",
|
"-s", "--suffix",
|
||||||
type = str,
|
type=str,
|
||||||
default = DEFAULT_SUFFIX,
|
default=DEFAULT_SUFFIX,
|
||||||
metavar = "SUFFIX",
|
metavar="SUFFIX",
|
||||||
help = f"use SUFFIX as file name suffix, default: {DEFAULT_SUFFIX}"
|
help=f"use SUFFIX as file name suffix, default: {DEFAULT_SUFFIX}"
|
||||||
)
|
)
|
||||||
# timestamp format
|
# timestamp format
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-t",
|
"-t",
|
||||||
"--timestamp-format",
|
"--timestamp-format",
|
||||||
type = str,
|
type=str,
|
||||||
default = DEFAULT_TIMESTAMP_FORMAT,
|
default=DEFAULT_TIMESTAMP_FORMAT,
|
||||||
metavar = "FORMAT",
|
metavar="FORMAT",
|
||||||
help = f"format of timestamp, default: {DEFAULT_TIMESTAMP_FORMAT}".replace(r"%",r"%%")
|
help=f"format of timestamp, default: {DEFAULT_TIMESTAMP_FORMAT}".replace(r"%", r"%%")
|
||||||
)
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
Loading…
Reference in New Issue