github.com/askholme/packer@v0.7.2-0.20140924152349-70d9566a6852/packer/command.go (about)

     1  package packer
     2  
     3  // A command is a runnable sub-command of the `packer` application.
     4  // When `packer` is called with the proper subcommand, this will be
     5  // called.
     6  //
     7  // The mapping of command names to command interfaces is in the
     8  // Environment struct.
     9  type Command interface {
    10  	// Help should return long-form help text that includes the command-line
    11  	// usage, a brief few sentences explaining the function of the command,
    12  	// and the complete list of flags the command accepts.
    13  	Help() string
    14  
    15  	// Run should run the actual command with the given environmet and
    16  	// command-line arguments. It should return the exit status when it is
    17  	// finished.
    18  	Run(env Environment, args []string) int
    19  
    20  	// Synopsis should return a one-line, short synopsis of the command.
    21  	// This should be less than 50 characters ideally.
    22  	Synopsis() string
    23  }