diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-01 21:50:04 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-01 21:50:04 +0100 |
commit | 6eca3af569997f28eee9d169a68cef4bbd6fd789 (patch) | |
tree | e66bdd119a7d0b5a57b8fb9c272a9b2ac1892b60 /bsie.app | |
parent | ec9105b690974b0246e36769506e735c4edf069a (diff) | |
download | bsie-6eca3af569997f28eee9d169a68cef4bbd6fd789.tar.gz bsie-6eca3af569997f28eee9d169a68cef4bbd6fd789.tar.bz2 bsie-6eca3af569997f28eee9d169a68cef4bbd6fd789.zip |
Integrate main app into package
Diffstat (limited to 'bsie.app')
-rwxr-xr-x | bsie.app | 49 |
1 files changed, 3 insertions, 46 deletions
@@ -1,49 +1,6 @@ -"""BSIE tools. - -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" -# standard imports -import argparse -import typing - -# bsie imports -import bsie -import bsie.apps - -# exports -__all__: typing.Sequence[str] = ( - 'main', - ) - -# config -apps = { - 'index' : bsie.apps.index, - 'info' : bsie.apps.info, - } - - -## code ## - -def main(argv): - """Black Star File System maintenance tools.""" - parser = argparse.ArgumentParser(description=main.__doc__, prog='bsie') - parser.add_argument('--version', action='version', - version='%(prog)s version {}.{}.{}'.format(*bsie.version_info)) - parser.add_argument('app', choices=apps.keys(), - help='Select the application to run.') - parser.add_argument('rest', nargs=argparse.REMAINDER) - # parse - args = parser.parse_args() - # run application - apps[args.app](args.rest) - - -## main ## - +#!/usr/bin/env python3 if __name__ == '__main__': + import bsie.apps import sys - main(sys.argv[1:]) + bsie.apps.main(sys.argv[1:]) -## EOF ## |