generated from Luis/nextjs-python-web-template
29 lines
645 B
Python
Executable File
29 lines
645 B
Python
Executable File
# !/usr/bin/env python3
|
|
import argparse
|
|
import sys
|
|
|
|
has_argcomplete = True
|
|
try:
|
|
import argcomplete
|
|
except ImportError:
|
|
has_argcomplete = False
|
|
|
|
from . import admin
|
|
|
|
|
|
# this will be the entrypoint under /bin/clan (see pyproject.toml config)
|
|
def main() -> None:
|
|
parser = argparse.ArgumentParser(description="cLAN tool")
|
|
subparsers = parser.add_subparsers()
|
|
|
|
parser_admin = subparsers.add_parser("admin")
|
|
admin.register_parser(parser_admin)
|
|
if has_argcomplete:
|
|
argcomplete.autocomplete(parser)
|
|
parser.parse_args()
|
|
if len(sys.argv) == 1:
|
|
parser.print_help()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|