From 120757bfd38f709c3be2244b2a1f716cd88c0db6 Mon Sep 17 00:00:00 2001 From: 7000pctAUTO Date: Fri, 30 Jan 2026 07:11:34 +0000 Subject: [PATCH] Add shell completion templates and manpage template --- src/templates/manpage.handlebars | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/templates/manpage.handlebars diff --git a/src/templates/manpage.handlebars b/src/templates/manpage.handlebars new file mode 100644 index 0000000..a1964ad --- /dev/null +++ b/src/templates/manpage.handlebars @@ -0,0 +1,64 @@ +.TH {{spec.name}} 1 "{{spec.version}}" "{{spec.author}}" "{{spec.name}}" +.SH NAME +{{spec.name}} \- {{spec.description}} +.SH SYNOPSIS +\fB{{spec.name}}\fR [\fB--version\fR] [\fB--help\fR] [\fB\fR] \fB\fR [\fB\fR] +.SH DESCRIPTION +{{spec.description}} +{{#if spec.author}} +.PP +Author: {{spec.author}} +{{/if}} +{{#if spec.license}} +.PP +License: {{spec.license}} +{{/if}} +.SH OPTIONS +{{#each spec.globalOptions}} +.TP +\fB{{#if short}}-\fR\fB{{short}}\fR, \fB{{/if}}--\fB{{name}}\fR +{{escape description}} +{{#if type}} +Type: \fB{{type}}\fR{{/if}} +{{#if required}} +Required{{/if}} +{{#if default}} +Default: \fB{{defaultValue}}\fR{{/if}} +{{/each}} +.SH COMMANDS +{{#each spec.commands}} +.TP +\fB{{name}}\fR{{#if aliases}} (alias: \fB{{aliases}}\fR){{/if}} +{{escape description}} +{{#if options}} +.SS Options for '{{name}}': +{{#each options}} +.TP +\fB{{#if short}}-\fR\fB{{short}}\fR, \fB{{/if}}--\fB{{name}}\fR +{{escape description}} +{{/each}} +{{/if}} +{{#if arguments}} +.SS Arguments for '{{name}}': +{{#each arguments}} +.TP +\fB{{name}}\fR +{{escape description}}{{#if required}} (required){{/if}}{{#if variadic}} (variadic){{/if}} +{{/each}} +{{/if}} +{{/each}} +{{#if spec.examples}} +.SH EXAMPLES +{{#each spec.examples}} +.TP +\fB{{description}}\fR +.EX +$ {{command}} +{{#if output}} +{{output}} +.EE +{{/if}} +{{/each}} +{{/if}} +.SH VERSION +This man page was generated for \fB{{spec.name}}\fR version \fB{{spec.version}}\fR.