Update url

This commit is contained in:
jpk 2023-08-15 12:16:02 +02:00
parent a76b7d81cc
commit ac4f140ff3
3 changed files with 22 additions and 21 deletions

View File

@ -4,17 +4,17 @@
Add `clickusagemd` as development dependency to your Poetry project.
```sh
poetry add -D git+ssh://git@git.goatpr0n.de/Tools/clickusagemd.git
poetry add -D git+https://git@git.goatpr0n.de/public/clickusagemd.git
```
By adding a revision tag you can stay on a — at least for you — working version, instead of working with the latest and
possible broken commit.
The latest recommended revision is: **0.6.2**.
The latest recommended revision is: **0.8.2**.
**To install:**
```sh
poetry add -D git+ssh://git@git.goatpr0n.de/Tools/clickusagemd.git@0.6.2
poetry add -D git+https://git.goatpr0n.de/public/clickusagemd.git@0.8.2
```
After installing, register the *pre-push* hook.
@ -37,6 +37,7 @@ poetry update
See [USAGE.md](USAGE.md).
## Uninstall
*Clickusagemd* can be uninstalled by removing the *pre-push* hook with
```sh
poetry run clickusagemd uninstall

View File

@ -1,14 +1,5 @@
# Clickusagemd v0.7.0 - Command Usage Overview
## run
```
Usage: clickusagemd run [OPTIONS] [POETRY_PROJECT_FILE]
Generate markdown usage description.
Options:
--help Show this message and exit.
```
## install
# Clickusagemd v0.8.2 - clickusagemd - Command Usage Overview
## clickusagemd install
```
Usage: clickusagemd install [OPTIONS]
@ -17,7 +8,16 @@ Usage: clickusagemd install [OPTIONS]
Options:
--help Show this message and exit.
```
## uninstall
## clickusagemd run
```
Usage: clickusagemd run [OPTIONS] [POETRY_PROJECT_FILE]
Generate markdown usage description.
Options:
--help Show this message and exit.
```
## clickusagemd uninstall
```
Usage: clickusagemd uninstall [OPTIONS]

View File

@ -43,12 +43,12 @@ def iter_commands(
else:
cmd_title = cliobj.name
yield f"{'#'*(depth)} {name} {cmd_title}\n```\n{help_message}\n```"
yield f"{'#'*(depth)} {tool_name} {cmd_title}\n```\n{help_message}\n```"
def generate_usage_md(script: str, version: str):
name, module = script
assert ":" in script
script_name, module = script
assert ":" in module
module_name, cliobj = module.split(":")
if "." in module_name:
module_name = module_name.split(".")[0]
@ -60,9 +60,9 @@ def generate_usage_md(script: str, version: str):
with open("USAGE.md", "wt") as fd:
print(
f"# {module_name.capitalize()} v{version} - {name} - Command Usage Overview", file=fd
f"# {module_name.capitalize()} v{version} - {script_name} - Command Usage Overview", file=fd
)
for command in iter_commands(name, [], cli):
for command in iter_commands(script_name, [], cli):
print(command, file=fd)
@ -83,7 +83,7 @@ def run(ctx, poetry_project_file):
try:
scripts = contents["tool"]["poetry"]["scripts"].items()
version = contents["tool"]["poetry"]["version"]
for script in scripts.values():
for script in scripts:
generate_usage_md(script, version)
except KeyError:
click.echo("[ERROR] File does not contain 'tool.poetry.scripts' definitions.")