You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

49 lines
1.2 KiB

#!/usr/bin/env python3
import click
# TODO: replace with plugin manager
from database import database
from automate import automate
from reqbt import reqbt
from charts import charts
_commands = [
database,
automate,
reqbt,
charts
]
# main-entry point to the entire command-line interface
@click.group()
@click.option('-v', '--verbose', help='Print additional information.',
is_flag=True)
@click.pass_context
def cli(ctx, verbose):
"""
A command-line interface wrapper to the Criminal Justice Software toolchain.\f
Args:
ctx: Click command-line interface context.
verbose: Flag to enable additional prints.
database: Path to a SQLite3 database.
"""
ctx.ensure_object(dict)
# initialize context object
# store non-click information
# TODO: replace hard coded path with a more cross-platform method
ctx.obj['data_dir'] = '/home/csguest/Desktop/cjsoftware/cjs/.data'
ctx.obj['resource_dir'] = '/home/csguest/Dekstop/cjsoftware/cjs/resources'
# store click-related information
# global flags
ctx.obj['verbose'] = verbose
# load external modules into cli
for cmd in _commands:
cli.add_command(cmd)
if __name__ == '__main__':
cli()