add args command name
This commit is contained in:
parent
ebc6206ec9
commit
7e484fa308
@ -11,7 +11,7 @@ if __name__ == '__main__':
|
||||
parser.add_argument("--logfile", help="Log file", default="")
|
||||
parser.add_argument("--quiet", help="No console output", action="store_true")
|
||||
|
||||
subparsers = parser.add_subparsers()
|
||||
subparsers = parser.add_subparsers(dest="command")
|
||||
|
||||
import_parser = subparsers.add_parser("import")
|
||||
import_parser.add_argument("--user", help="wordpress user", required=True)
|
||||
@ -33,6 +33,7 @@ if __name__ == '__main__':
|
||||
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
logger = logging.getLogger('insert wordpress')
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
|
||||
@ -57,6 +58,7 @@ if __name__ == '__main__':
|
||||
fileHandler.setFormatter(formatter)
|
||||
logger.addHandler(fileHandler)
|
||||
|
||||
if args.command == "export":
|
||||
password = getpass()
|
||||
if len(password) == 0:
|
||||
logger.error("No password error !!! ")
|
||||
|
Loading…
x
Reference in New Issue
Block a user