github.com/aergoio/aergo@v1.3.1/cmd/brick/exec/exit.go (about)

     1  package exec
     2  
     3  import (
     4  	"os"
     5  )
     6  
     7  func init() {
     8  	registerExec(&exit{})
     9  }
    10  
    11  type exit struct{}
    12  
    13  func (c *exit) Command() string {
    14  	return "exit"
    15  }
    16  
    17  func (c *exit) Syntax() string {
    18  	return ""
    19  }
    20  
    21  func (c *exit) Usage() string {
    22  	return "exit"
    23  }
    24  
    25  func (c *exit) Describe() string {
    26  	return "exit this application"
    27  }
    28  
    29  func (c *exit) Validate(args string) error {
    30  	return nil
    31  }
    32  
    33  func (c *exit) Run(args string) (string, error) {
    34  
    35  	os.Exit(0) // exit program
    36  	return "", nil
    37  }