Add command to generate man pages

The climan package has a command that can be registered with any urfav
cli app to generate man pages.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby
2019-09-10 12:12:25 -04:00
parent 65a6d0a82f
commit f3a5b8c0a9
40 changed files with 2811 additions and 1596 deletions

View File

@@ -30,6 +30,7 @@ import (
"github.com/containerd/containerd"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/pkg/climan"
"github.com/containerd/containerd/plugin"
metrics "github.com/docker/go-metrics"
"github.com/sirupsen/logrus"
@@ -161,6 +162,7 @@ func main() {
}
app.Commands = []cli.Command{
densityCommand,
climan.Command,
}
app.Action = func(context *cli.Context) error {
config := config{

View File

@@ -70,6 +70,17 @@ func App() *cli.App {
app.Name = "containerd"
app.Version = version.Version
app.Usage = usage
app.Description = `
containerd is a high performance container runtime whose daemon can be started
by using this command. If none of the *config*, *publish*, or *help* commands
are specified, the default action of the **containerd** command is to start the
containerd daemon in the foreground.
A default configuration is used if no TOML configuration is specified or located
at the default file location. The *containerd config* command can be used to
generate the default configuration for containerd. The output of that command
can be used and modified as necessary as a custom configuration.`
app.Flags = []cli.Flag{
cli.StringFlag{
Name: "config,c",

View File

@@ -21,6 +21,7 @@ import (
"os"
"github.com/containerd/containerd/cmd/containerd/command"
"github.com/containerd/containerd/pkg/climan"
"github.com/containerd/containerd/pkg/seed"
)
@@ -30,6 +31,7 @@ func init() {
func main() {
app := command.App()
app.Commands = append(app.Commands, climan.Command)
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "containerd: %s\n", err)
os.Exit(1)

View File

@@ -57,6 +57,11 @@ func New() *cli.App {
app := cli.NewApp()
app.Name = "ctr"
app.Version = version.Version
app.Description = `
ctr is an unsupported debug and administrative client for interacting
with the containerd daemon. Because it is unsupported, the commands,
options, and operations are not guaranteed to be backward compatible or
stable from release to release of the containerd project.`
app.Usage = `
__
_____/ /______

View File

@@ -21,6 +21,7 @@ import (
"os"
"github.com/containerd/containerd/cmd/ctr/app"
"github.com/containerd/containerd/pkg/climan"
"github.com/containerd/containerd/pkg/seed"
"github.com/urfave/cli"
)
@@ -34,6 +35,7 @@ func init() {
func main() {
app := app.New()
app.Commands = append(app.Commands, pluginCmds...)
app.Commands = append(app.Commands, climan.Command)
if err := app.Run(os.Args); err != nil {
fmt.Fprintf(os.Stderr, "ctr: %s\n", err)
os.Exit(1)