mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-06-07 12:10:32 +01:00
add man/generate.py - generates man files
add hatch script man to invoke the generate script.
This commit is contained in:
parent
fd580f290f
commit
7d36af1a15
1
.gitignore
vendored
1
.gitignore
vendored
@ -176,4 +176,5 @@ pyrightconfig.json
|
|||||||
|
|
||||||
# End of gignore: github.com/onyx-and-iris/gignore
|
# End of gignore: github.com/onyx-and-iris/gignore
|
||||||
|
|
||||||
|
man/*.1
|
||||||
test-*.py
|
test-*.py
|
21
man/generate.py
Normal file
21
man/generate.py
Normal file
@ -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()
|
@ -27,6 +27,7 @@ dependencies = [
|
|||||||
"pydantic-settings>=2.9.1",
|
"pydantic-settings>=2.9.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Documentation = "https://github.com/onyx-and-iris/obsws-cli#readme"
|
Documentation = "https://github.com/onyx-and-iris/obsws-cli#readme"
|
||||||
Issues = "https://github.com/onyx-and-iris/obsws-cli/issues"
|
Issues = "https://github.com/onyx-and-iris/obsws-cli/issues"
|
||||||
@ -38,8 +39,12 @@ obsws-cli = "obsws_cli:app"
|
|||||||
[tool.hatch.version]
|
[tool.hatch.version]
|
||||||
path = "obsws_cli/__about__.py"
|
path = "obsws_cli/__about__.py"
|
||||||
|
|
||||||
|
[tool.hatch.envs.default]
|
||||||
|
dependencies = ["click-man>=0.5.1"]
|
||||||
|
|
||||||
[tool.hatch.envs.default.scripts]
|
[tool.hatch.envs.default.scripts]
|
||||||
cli = "obsws-cli {args:}"
|
cli = "obsws-cli {args:}"
|
||||||
|
man = "python man/generate.py"
|
||||||
|
|
||||||
[tool.hatch.envs.hatch-test]
|
[tool.hatch.envs.hatch-test]
|
||||||
dependencies = ["pytest>=8.3.5"]
|
dependencies = ["pytest>=8.3.5"]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user