[UPD] script db_restore: better description help

- show nothing when nothing to do
This commit is contained in:
Mathieu Benoit 2023-01-17 21:44:30 -05:00
parent ad0c9b24fb
commit 2732942633

View file

@ -22,21 +22,25 @@ def get_config():
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
description="""\
Restore database, use cache to clone to improve speed.
DESCRIPTION
Restore database, use cache to clone to improve speed.
SUGGESTION
./script/database/db_restore.py -d test
""",
epilog="""\
""",
)
# parser.add_argument('-d', '--dir', dest="dir", default="./",
# help="Path of repo to change remote, including submodule.")
parser.add_argument("--database", help="Database to manipulate.")
parser.add_argument("-d", "--database", help="Database to manipulate.")
parser.add_argument(
"--image",
default="erplibre_base",
help=(
"Image name to restore, from directory image_db, filename without"
" '.zip'. Example, use erplibre_base to use image"
" erplibre_base.zip."
" erplibre_base.zip. Default value is erplibre_base"
),
)
parser.add_argument(
@ -134,6 +138,9 @@ def main():
out = check_output(arg.split(" ")).decode()
print(out)
if not config.clean_cache and not config.database:
print("Nothing to do.")
if __name__ == "__main__":
main()