feat(console): added command to generate man pages

This commit is contained in:
Jef Roosens 2022-06-01 13:59:52 +02:00 committed by Jef Roosens
parent 06df2c21f0
commit 329e819e15
Signed by untrusted user: Jef Roosens
GPG key ID: B580B976584B5F30
8 changed files with 51 additions and 0 deletions

21
src/console/man/man.v Normal file
View file

@ -0,0 +1,21 @@
module man
import cli
import console
import os
// cmd returns the cli submodule that handles generating man pages.
pub fn cmd() cli.Command {
return cli.Command{
name: 'man'
description: 'Generate all man pages & save them in the given directory.'
usage: 'dir'
required_args: 1
execute: fn (cmd cli.Command) ? {
root := cmd.root()
os.mkdir_all(cmd.args[0])?
console.export_man_pages(root, cmd.args[0])?
}
}
}