Added command line tool and removed lib folder from gitignore.
This commit is contained in:
24
util/python_module/sppcmd/__init__.py
Normal file
24
util/python_module/sppcmd/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
"""
|
||||
Scons++ Command Line Interface
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import logging
|
||||
|
||||
from .ccjson import make_ccjson_parser
|
||||
|
||||
_STDOUT_LOG_FORMAT = '%(message)s'
|
||||
|
||||
def run_spp_cmd() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--verbose', '-v', action='store_true')
|
||||
subparsers = parser.add_subparsers(required=True)
|
||||
|
||||
make_ccjson_parser(subparsers)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(format=_STDOUT_LOG_FORMAT, level=logging.DEBUG if args.verbose else logging.INFO)
|
||||
args.handler(args)
|
||||
|
||||
return 0
|
||||
Reference in New Issue
Block a user