Skip to content

Commit

Permalink
feat: standardized CLI #9
Browse files Browse the repository at this point in the history
  • Loading branch information
Max KvR committed Sep 11, 2024
1 parent c977c16 commit 930138f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions metricq_source_modbus/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@

import logging

import click
import click_completion # type: ignore
import click_log # type: ignore
from metricq.logging import get_logger
from metricq.cli import metricq_command

from .source import ModbusSource

Expand All @@ -46,9 +46,7 @@
click_completion.init()


@click.command()
@click.option("--server")
@click.option("--token", default="source-modbus")
@metricq_command(default_token = "source-modbus")
@click_log.simple_verbosity_option(logger) # type: ignore
def run(server, token) -> None:
src = ModbusSource(url=server, token=token)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ packages =
metricq_source_modbus
python_requires = >=3.10
install_requires =
metricq ~= 5.3
metricq[cli] ~= 5.4
async-modbus >= 0.2.1
python-hostlist
pydantic
Expand Down

0 comments on commit 930138f

Please sign in to comment.