Add shell completion templates and manpage template

This commit is contained in:
2026-01-30 07:11:34 +00:00
parent 66dce8c310
commit 120757bfd3

View File

@@ -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<global-options>\fR] \fB<command>\fR [\fB<args>\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.