Skip to content

Commit 4e5fbcf

Browse files
committed
Perform check on the number of arguments
1 parent 16d76f7 commit 4e5fbcf

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

postgres_plugin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
import sys
33
import json
44
from postgresql import PgInfo
5+
from os import path
6+
7+
if (len(sys.argv) != 7):
8+
sys.stderr.write("usage: {0} host port database user password source\n".format(path.basename(sys.argv[0])))
9+
sys.exit(1)
510

611
#grab connection info's. This is expected in the Format host/port/db/user/pwd
712
_host = sys.argv[1]

0 commit comments

Comments
 (0)