File size: 698 Bytes
2226ee3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""Lilac CLI."""

import click

from . import __version__
from .server import start_server


@click.command()
@click.option(
  '--host',
  help='The host address where the web server will listen to.',
  default='0.0.0.0',
  type=str)
@click.option('--port', help='The port number of the web-server', type=int, default=5432)
def start(host: str, port: int) -> None:
  """Starts the Lilac web server."""
  start_server(host=host, port=port, open=True)


@click.command()
def version() -> None:
  """Prints the version of Lilac."""
  print(__version__)


@click.group()
def cli() -> None:
  """Lilac CLI."""
  pass


cli.add_command(start)
cli.add_command(version)

if __name__ == '__main__':
  cli()