mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Renamed project to immutabase
This commit is contained in:
parent
a0bb9da17f
commit
25c241fa5a
18 changed files with 636 additions and 636 deletions
28
immutabase/cli.py
Normal file
28
immutabase/cli.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
import click
|
||||
from click_default_group import DefaultGroup
|
||||
from .app import app_factory, ensure_build_metadata
|
||||
|
||||
|
||||
@click.group(cls=DefaultGroup, default='serve', default_if_no_args=True)
|
||||
def cli():
|
||||
"""
|
||||
Immutabase!
|
||||
"""
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.argument('files', type=click.Path(exists=True), nargs=-1)
|
||||
def build(files):
|
||||
ensure_build_metadata(files, True)
|
||||
|
||||
|
||||
@cli.command()
|
||||
@click.argument('files', type=click.Path(exists=True), nargs=-1)
|
||||
@click.option('-h', '--host', default='0.0.0.0')
|
||||
@click.option('-p', '--port', default=8001)
|
||||
@click.option('--debug', is_flag=True)
|
||||
def serve(files, host, port, debug):
|
||||
"""Serve up specified database files with a web UI"""
|
||||
click.echo('Serve! files={} on port {}'.format(files, port))
|
||||
app = app_factory(files)
|
||||
app.run(host=host, port=port, debug=debug)
|
||||
Loading…
Add table
Add a link
Reference in a new issue