[UPD] script db_restore: better description help
- show nothing when nothing to do
This commit is contained in:
parent
ad0c9b24fb
commit
2732942633
1 changed files with 10 additions and 3 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue