Change --verbose short to -V, add --version/-v, add IRCBot.VERSION
This commit is contained in:
parent
8d55319f56
commit
276d753711
2 changed files with 9 additions and 1 deletions
|
@ -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 EventManager, Exports, IRCServer, Logging, ModuleManager
|
||||||
from src import Socket, utils
|
from src import Socket, utils
|
||||||
|
|
||||||
|
VERSION = "v1.2.0"
|
||||||
|
|
||||||
TRIGGER_RETURN = 1
|
TRIGGER_RETURN = 1
|
||||||
TRIGGER_EXCEPTION = 2
|
TRIGGER_EXCEPTION = 2
|
||||||
|
|
||||||
|
|
8
start.py
8
start.py
|
@ -26,11 +26,17 @@ arg_parser.add_argument("--log-dir", "-l",
|
||||||
arg_parser.add_argument("--add-server", "-a",
|
arg_parser.add_argument("--add-server", "-a",
|
||||||
help="Add a new server", action="store_true")
|
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("--log-level", "-L")
|
||||||
|
|
||||||
|
arg_parser.add_argument("--version", "-v", action="store_true")
|
||||||
|
|
||||||
args = arg_parser.parse_args()
|
args = arg_parser.parse_args()
|
||||||
|
|
||||||
|
if args.version:
|
||||||
|
print("BitBot %s" % IRCBot.VERSION)
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
log_level = args.log_level
|
log_level = args.log_level
|
||||||
if not log_level:
|
if not log_level:
|
||||||
log_level = "debug" if args.verbose else "info"
|
log_level = "debug" if args.verbose else "info"
|
||||||
|
|
Loading…
Reference in a new issue