Skip to content

Commit

Permalink
Added a sample CLI template
Browse files Browse the repository at this point in the history
Add CLI interface
  • Loading branch information
giswqs committed Jul 24, 2023
2 parents 321eef3 + 7c5434e commit a82f129
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions open_buildings/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,27 @@
import click


@click.command()
def main(args=None):
@click.group()
def main():
"""Console script for open_buildings."""
click.echo("Replace this message by putting your code into "
"open_buildings.cli.main")
click.echo("See click documentation at https://click.palletsprojects.com/")
return 0
pass


@main.command()
@click.argument('name')
def convert(name):
"""Create a new building with the given name."""
click.echo(f"Creating a new building: {name}")
# Add your logic to create a new building here


@main.command()
@click.argument('building_id')
def info(building_id):
"""Get information about a specific building."""
click.echo(f"Getting information for building with ID: {building_id}")
click.echo("More info...")
# Add your logic to fetch building information here


if __name__ == "__main__":
Expand Down

0 comments on commit a82f129

Please sign in to comment.