From 2732942633320b691eeee771ef46c9f6b10deb3f Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Tue, 17 Jan 2023 21:44:30 -0500 Subject: [PATCH] [UPD] script db_restore: better description help - show nothing when nothing to do --- script/database/db_restore.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/script/database/db_restore.py b/script/database/db_restore.py index 7d1fdf4..af3dce1 100755 --- a/script/database/db_restore.py +++ b/script/database/db_restore.py @@ -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()