github.com/containers/libpod@v1.9.4-0.20220419124438-4284fd425507/cmd/podman/generate.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/containers/libpod/cmd/podman/cliconfig"
     5  	"github.com/spf13/cobra"
     6  )
     7  
     8  var (
     9  	generateCommand     cliconfig.PodmanCommand
    10  	generateDescription = "Generate structured data based for a containers and pods"
    11  	_generateCommand    = &cobra.Command{
    12  		Use:   "generate",
    13  		Short: "Generated structured data",
    14  		Long:  generateDescription,
    15  		RunE:  commandRunE(),
    16  	}
    17  
    18  	//	Commands that are universally implemented
    19  	generateCommands = []*cobra.Command{
    20  		_containerKubeCommand,
    21  	}
    22  )
    23  
    24  func init() {
    25  	// Systemd-service generation is not supported for remote-clients.
    26  	if !remoteclient {
    27  		generateCommands = append(generateCommands, _containerSystemdCommand)
    28  	}
    29  	generateCommand.Command = _generateCommand
    30  	generateCommand.AddCommand(generateCommands...)
    31  	generateCommand.SetUsageTemplate(UsageTemplate())
    32  }