{"id":15831425,"url":"https://github.com/somajitdey/helpdoc","last_synced_at":"2025-05-12T13:11:58.438Z","repository":{"id":163920159,"uuid":"582784821","full_name":"SomajitDey/helpdoc","owner":"SomajitDey","description":"A KISS CLI tool for managing GNU-style help messages. Extracts help messages from comments in source code and prints them when asked.","archived":false,"fork":false,"pushed_at":"2023-02-07T14:34:27.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-12T13:11:50.219Z","etag":null,"topics":["bash","cli","command-line","extract","gnu-linux","help","manpage","parser","sourcecode"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SomajitDey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-27T21:29:51.000Z","updated_at":"2023-02-06T15:26:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"44ee97be-7742-4b27-9ff3-afc217f1d055","html_url":"https://github.com/SomajitDey/helpdoc","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"e785e431572fbaa213d169f6e8f0c57da88507e0"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SomajitDey%2Fhelpdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SomajitDey%2Fhelpdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SomajitDey%2Fhelpdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SomajitDey%2Fhelpdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SomajitDey","download_url":"https://codeload.github.com/SomajitDey/helpdoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253745175,"owners_count":21957318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","command-line","extract","gnu-linux","help","manpage","parser","sourcecode"],"created_at":"2024-10-05T12:02:32.426Z","updated_at":"2025-05-12T13:11:58.394Z","avatar_url":"https://github.com/SomajitDey.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# helpdoc\nA KISS CLI tool for managing GNU-style help messages. Extracts help messages from comments in source code and prints them when asked.\n\n## Purpose\nA good command-line tool needs to produce a help message containing its *usage* information (e.g. `cat --help`). It may also produce texts containing information such as *about*, *version*, *author*, *license* etc. (e.g. `cat --version`).\n\nGood coding style also demands these information to be documented as comments in the prelude of the corresponding source code.\n\nUsually, therefore, one would need to write the help text twice - \n1. as comments at the beginning of the source code, and \n2. as character string(s) inside the code that will print the help text for the end-user.\n\n`helpdoc` comes to the rescue by eliminating the repetition in step 2 above.\n\n## Design / How it works\nThe workflow of `helpdoc` is very simple:\n- Extract *commented* help texts from the source code of any given `\u003ccommand\u003e` and store the extracted text in a local/system-wide database:\n```bash\nhelpdoc -e \u003csource code path\u003e \u003ccommand\u003e\n```\n- Print the stored text when invoked: \n```bash\nhelpdoc \u003ccommand\u003e\n```\n\n`helpdoc` should be able to extract the help text, documented as comments, from the source code written in any programming language, i.e. it's supposed to be language-agnostic. Printing of the help text requires a *system call* to `helpdoc`, provision for which is usually there in every standard programming language.\n\nThe end-user only needs to install `helpdoc` once as a common dependency.\n\n## Syntax\n\nExtraction of help text from the comment lines in the source code requires parsing according to some well-defined syntax. `helpdoc` recognizes the following syntax.\n\n- Help messages must be written in as single-line comments only. For discussion's sake, assume the single-line comment marker is `//` (as in the C language).\n\n- The entire message block must be put between the header, `//help:begin` and the footer, `//help:end`, both case-insensitive. Spaces/tabs are allowed before and after these phrases. Spaces/tabs may also separate the comment marker `//` and `help:begin` or `help:end`.\n\n- *Usage* message must start with the case-insensitive prefix, `//Usage:`. Spaces/tabs are allowed as above.\n\n- Whatever comes before the *Usage* message (i.e. before the `//Usage:` prefix) is considered the *About* message. It may contain repository URL, author information, license, version etc.\n \n- Version information, if any, must start with the case-insensitive `//Version: ` prefix and must come before the *Usage* message.\n\nSee [examples](examples/) for illustration.\n\n## Installation\n- Download with \n```bash\ngit clone https://github.com/SomajitDey/helpdoc\n```\n- Install with (requires `sudo` priviledge)\n```bash\nmake\n```\n- Uninstall with (requires `sudo` priviledge)\n```bash\nmake uninstall\n```\n\n## Usage\nFor usage information, consult `helpdoc` help\n```bash\nhelpdoc helpdoc\n```\nor, equivalently,\n```bash\nhelpdoc -h\n```\n*Dogfooding Note*: `helpdoc` uses itself to serve its own help message.\n\n## Examples\nExtract and store help message for [hello_world](examples/hello_world.c):\n```bash\nhelpdoc -e examples/hello_world.c\n```\n\nTo show command-line help, `hello_world --help|-h` can now simply make a system call to \n```bash\nhelpdoc hello_world\n```\n\n## Feedback\n[Bug-reports](https://github.com/SomajitDey/helpdoc/issues) and [suggestions for improvement](https://github.com/SomajitDey/helpdoc/discussions) are welcome.\n\n## License\n[MIT](https://github.com/SomajitDey/helpdoc/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomajitdey%2Fhelpdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsomajitdey%2Fhelpdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsomajitdey%2Fhelpdoc/lists"}