Skip to content

Commit ca95f77

Browse files
Allow forcing cmsDropDB
1 parent c9cd272 commit ca95f77

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

scripts/cmsDropDB

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,17 @@ def main():
5353
test_db_connection()
5454

5555
parser = argparse.ArgumentParser(description=__doc__)
56+
parser.add_argument("-y", "--yes", action="store_true",
57+
help="do not require confirmation")
5658
args = parser.parse_args()
5759

58-
print("Are you sure you want to DROP the database? [y/N] ", end='')
59-
ans = sys.stdin.readline().strip().lower()
60-
if ans in ["y", "yes"]:
60+
if not args.yes:
61+
print("Are you sure you want to DROP the database? [y/N] ", end='')
62+
ans = sys.stdin.readline().strip().lower()
63+
if ans in ["y", "yes"]:
64+
args.yes = True
65+
66+
if args.yes:
6167
print("Dropping database.")
6268
return drop_db()
6369
else:

0 commit comments

Comments
 (0)