Issue #45: scaffold Python package
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Command-line entry points for the MXAccess Gateway Python client."""
|
||||
@@ -0,0 +1,6 @@
|
||||
"""Module execution entry point for `python -m mxgateway_cli`."""
|
||||
|
||||
from .commands import main
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,29 @@
|
||||
"""CLI scaffold for the MXAccess Gateway Python client."""
|
||||
|
||||
import json
|
||||
|
||||
import click
|
||||
|
||||
from mxgateway import __version__
|
||||
|
||||
|
||||
@click.group()
|
||||
def main() -> None:
|
||||
"""MXAccess Gateway Python test CLI."""
|
||||
|
||||
|
||||
@main.command()
|
||||
@click.option("--json", "output_json", is_flag=True, help="Emit JSON output.")
|
||||
def version(output_json: bool) -> None:
|
||||
"""Print client package version information."""
|
||||
payload = {
|
||||
"client": "mxgw-py",
|
||||
"package": "mxaccess-gateway-client",
|
||||
"version": __version__,
|
||||
}
|
||||
|
||||
if output_json:
|
||||
click.echo(json.dumps(payload, sort_keys=True))
|
||||
return
|
||||
|
||||
click.echo(f"mxgw-py {__version__}")
|
||||
Reference in New Issue
Block a user