Change --verbose short to -V, add --version/-v, add IRCBot.VERSION

This commit is contained in:
jesopo 2019-02-24 08:37:42 +00:00
parent 8d55319f56
commit 276d753711
2 changed files with 9 additions and 1 deletions

View file

@ -2,6 +2,8 @@ import queue, os, select, socket, threading, time, traceback, typing, uuid
from src import EventManager, Exports, IRCServer, Logging, ModuleManager
from src import Socket, utils
VERSION = "v1.2.0"
TRIGGER_RETURN = 1
TRIGGER_EXCEPTION = 2

View file

@ -26,11 +26,17 @@ arg_parser.add_argument("--log-dir", "-l",
arg_parser.add_argument("--add-server", "-a",
help="Add a new server", action="store_true")
arg_parser.add_argument("--verbose", "-v", action="store_true")
arg_parser.add_argument("--verbose", "-V", action="store_true")
arg_parser.add_argument("--log-level", "-L")
arg_parser.add_argument("--version", "-v", action="store_true")
args = arg_parser.parse_args()
if args.version:
print("BitBot %s" % IRCBot.VERSION)
sys.exit(0)
log_level = args.log_level
if not log_level:
log_level = "debug" if args.verbose else "info"