help2man

Convert --help and --version to man page.

https://github.com/freed-wu/help2man

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (6.3%) to scientific vocabulary

Keywords

help2man python
Last synced: 6 months ago · JSON representation ·

Repository

Convert --help and --version to man page.

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 2
  • Open Issues: 6
  • Releases: 9
Topics
help2man python
Created about 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License Citation

README.md

help2man

pre-commit.ci status github/workflow codecov readthedocs

github/downloads github/downloads/latest github/issues github/issues-closed github/issues-pr github/issues-pr-closed github/discussions github/milestones github/forks github/stars github/watchers github/contributors github/commit-activity github/last-commit github/release-date

github/license github/languages github/languages/top github/directory-file-count github/code-size github/repo-size github/v

pypi/status pypi/v pypi/downloads pypi/format pypi/implementation pypi/pyversions

Convert --help and --version to man page or other file types like markdown.

Usage

```sh $ help2man --help usage: help2man [-h] [-V] [--print-completion {bash,zsh,tcsh}] [-n NAME] [-s SECTION] [-m MANUAL] [-S SOURCE] [-p INFO_PAGE] [-i INCLUDE] [-o OUTPUT] [--template {man,markdown}] [--template-file TEMPLATE_FILE] [--help-option HELP_OPTION] [--version-option VERSION_OPTION] [--no-discard-stderr] executable ...

Convert --help and --version to man page.

positional arguments: executable executable program name ... executable program arguments

options: -h, --help show this help message and exit -V, --version show program's version number and exit

...

$ help2man --version help2man 0.0.9 Copyright (C) 2022-2023 Written by Wu Zhenyu. ```

Man

sh help2man help2man | man --local-file -

```man HELP2MAN(1) User Commands HELP2MAN(1)

NAME help2man - Convert --help and --version to man page.

SYNOPSIS help2man [-h] [-V] [--print-completion {bash,zsh,tcsh}] [-n NAME] [-s SECTION] [-m MANUAL] [-S SOURCE] [-p INFO_PAGE] [-i INCLUDE] [-o OUTPUT] [--template {man,markdown}] [--template-file TEMPLATE_FILE] [--help-option HELP_OPTION] [--version-option VERSION_OPTION] [--no-discard-stderr] executable ...

DESCRIPTION Convert --help and --version to man page.

POSITIONAL ARGUMENTS executable executable program name

   ...    executable program arguments

OPTIONS -h, --help show this help message and exit

   -V, --version
          show program's version number and exit

...

AUTHOR Written by Wu Zhenyu.

REPORTING BUGS Report bugs to https://github.com/Freed-Wu/help2man/issues .

COPYRIGHT Copyright © 2022-2023

help2man 0.0.9 2024-11-02 HELP2MAN(1) ```

Markdown

sh help2man --template markdown help2man

```markdown

Man

Name

help2man - Convert ----help and ----version to man page.

Synopsis

help2man [-h] [-V] [----print-completion {bash,zsh,tcsh}] [-n NAME] [-s SECTION] [-m MANUAL] [-S SOURCE] [-p INFO_PAGE] [-i INCLUDE] [-o OUTPUT] [----template {man,markdown}] [----template-file TEMPLATE_FILE] [----help-option HELP_OPTION] [----version-option VERSION_OPTION] [----no-discard-stderr] executable ...

Description

Convert ----help and ----version to man page.

Positional arguments

executable

executable program name

...

executable program arguments

Options

-h, ----help

show this help message and exit

-V, ----version

show program's version number and exit

...

```

Similar Projects

  • GNU help2man Generate manpage for any program with --help and --version. Written in perl.
  • click-man Generate manpage for click-based python program. Written in python.
  • cli2man Generate manpage and markdown for any program with --help and --version. Written in python.
  • This project: Generate manpage, markdown or any format (if you provide a jinja template) for any program with --help and --version or any argparse-based python program.

Intention

This a python version of GNU help2man. It solves the following problems[^email]:

GNU help2man cannot convert argparse correctly

Because argparse outputs:

```text usage: help2man [-h] ... executable ...

Convert --help and --version to man page.

positional arguments: executable executable program name ...

options: -h show this help message and exit ... ```

help2man will ignore positional arguments: and options: because it only detect Options:. And it only detect first line as synopsis and detect other lines as description incorrectly.

GNU help2man cannot customize template

I provide help2man --template XXX and help2man --template-file XXX to do it. The template language is jinja2. See template as examples.

GNU help2man don't provide any programming API

Now you can use it in python. If you want to generate man pages automatically when you build a python project, you can see setuptools-generate:

See document to know more.

[^email]: I send email to the author of GNU help2man but got no response.

Owner

  • Name: wzy
  • Login: Freed-Wu
  • Kind: user
  • Location: $HOME
  • Company: @ustc-ivclab

An adherent of hacker culture and open source.

Citation (CITATION.cff)

---
cff-version: 1.2.0
message: If you use this software, please cite it as below.
authors:
  - family-names: Wu
    given-names: Zhenyu
    orcid: https://orcid.org/0000-0001-6478-9993
title: "help2man: Convert --help and --version to man page."
date-released: 2022-12-03
url: "https://github.com/Freed-Wu/help2man"

GitHub Events

Total
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 59
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1
Last Year
  • Issues event: 2
  • Watch event: 2
  • Issue comment event: 3
  • Push event: 59
  • Pull request review event: 2
  • Pull request review comment event: 1
  • Pull request event: 2
  • Fork event: 1
  • Create event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 29
  • Total Committers: 2
  • Avg Commits per committer: 14.5
  • Development Distribution Score (DDS): 0.034
Past Year
  • Commits: 3
  • Committers: 2
  • Avg Commits per committer: 1.5
  • Development Distribution Score (DDS): 0.333
Top Committers
Name Email Commits
Wu Zhenyu w****u@u****u 28
Alexandre ZANNI 1****j 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 5
  • Average time to close issues: 4 minutes
  • Average time to close pull requests: 12 months
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 0.25
  • Average comments per pull request: 0.8
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 2
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.5
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • doronbehar (1)
  • vapier (1)
  • noraj (1)
Pull Request Authors
  • vapier (2)
  • noraj (1)
  • pre-commit-ci[bot] (1)
  • renovate[bot] (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 1,345 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 12
  • Total versions: 7
  • Total maintainers: 1
pypi.org: help2man

Convert --help and --version to man page.

  • Versions: 7
  • Dependent Packages: 1
  • Dependent Repositories: 12
  • Downloads: 1,345 Last month
Rankings
Dependent repos count: 4.2%
Dependent packages count: 4.7%
Downloads: 8.3%
Average: 17.2%
Forks count: 29.8%
Stargazers count: 38.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/main.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • codecov/codecov-action v3 composite
  • pypa/gh-action-pypi-publish release/v1 composite
  • softprops/action-gh-release v1 composite
docs/requirements.txt pypi
  • myst-parser *
  • sphinxcontrib-eval *
  • tomli *
requirements/dev.txt pypi
  • pre-commit * development
  • pytest-cov * development
  • shtab * development
  • tomli * development
requirements.txt pypi
  • jinja2 *
.github/workflows/nix.yml actions
  • actions/checkout v3 composite
  • cachix/install-nix-action v22 composite
pyproject.toml pypi
setup.py pypi