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. Add `clickusagemd` as development dependency to your Poetry project.
```sh ```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 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. possible broken commit.
The latest recommended revision is: **0.6.2**. The latest recommended revision is: **0.8.2**.
**To install:** **To install:**
```sh ```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. After installing, register the *pre-push* hook.
@ -37,6 +37,7 @@ poetry update
See [USAGE.md](USAGE.md). See [USAGE.md](USAGE.md).
## Uninstall ## Uninstall
*Clickusagemd* can be uninstalled by removing the *pre-push* hook with *Clickusagemd* can be uninstalled by removing the *pre-push* hook with
```sh ```sh
poetry run clickusagemd uninstall poetry run clickusagemd uninstall

View File

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

View File

@ -43,12 +43,12 @@ def iter_commands(
else: else:
cmd_title = cliobj.name 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): def generate_usage_md(script: str, version: str):
name, module = script script_name, module = script
assert ":" in script assert ":" in module
module_name, cliobj = module.split(":") module_name, cliobj = module.split(":")
if "." in module_name: if "." in module_name:
module_name = module_name.split(".")[0] 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: with open("USAGE.md", "wt") as fd:
print( 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) print(command, file=fd)
@ -83,7 +83,7 @@ def run(ctx, poetry_project_file):
try: try:
scripts = contents["tool"]["poetry"]["scripts"].items() scripts = contents["tool"]["poetry"]["scripts"].items()
version = contents["tool"]["poetry"]["version"] version = contents["tool"]["poetry"]["version"]
for script in scripts.values(): for script in scripts:
generate_usage_md(script, version) generate_usage_md(script, version)
except KeyError: except KeyError:
click.echo("[ERROR] File does not contain 'tool.poetry.scripts' definitions.") click.echo("[ERROR] File does not contain 'tool.poetry.scripts' definitions.")