diff --git a/.gitignore b/.gitignore index 81393e6..985268b 100644 --- a/.gitignore +++ b/.gitignore @@ -176,4 +176,5 @@ pyrightconfig.json # End of gignore: github.com/onyx-and-iris/gignore -test-*.py \ No newline at end of file +man/*.1 +test-*.py diff --git a/man/generate.py b/man/generate.py new file mode 100644 index 0000000..f800e09 --- /dev/null +++ b/man/generate.py @@ -0,0 +1,21 @@ +"""script for generating man pages for the CLI.""" + +import typer +from click_man.core import write_man_pages + +from obsws_cli import app +from obsws_cli.__about__ import __version__ + + +def make_man(): + """Generate man pages for the CLI.""" + cli = typer.main.get_command(app) + name = 'obsws-cli' + version = __version__ + target_dir = './man' + write_man_pages(name, cli, version=version, target_dir=target_dir) + return + + +if __name__ == '__main__': + make_man() diff --git a/pyproject.toml b/pyproject.toml index 83221d2..57109a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,7 @@ dependencies = [ "pydantic-settings>=2.9.1", ] + [project.urls] Documentation = "https://github.com/onyx-and-iris/obsws-cli#readme" Issues = "https://github.com/onyx-and-iris/obsws-cli/issues" @@ -38,8 +39,12 @@ obsws-cli = "obsws_cli:app" [tool.hatch.version] path = "obsws_cli/__about__.py" +[tool.hatch.envs.default] +dependencies = ["click-man>=0.5.1"] + [tool.hatch.envs.default.scripts] cli = "obsws-cli {args:}" +man = "python man/generate.py" [tool.hatch.envs.hatch-test] dependencies = ["pytest>=8.3.5"]