github.com/krzko/gosh@v0.0.0-20241128233202-5abd4ef06633/internal/shell/builtins/exit.go (about)

     1  // internal/shell/builtins/exit.go
     2  package builtins
     3  
     4  import (
     5  	"os"
     6  )
     7  
     8  type ExitCommand struct{}
     9  
    10  func (e *ExitCommand) Execute(args []string) error {
    11  	os.Exit(0)
    12  	return nil
    13  }
    14  
    15  func (e *ExitCommand) Help() string {
    16  	return "exit: Exit the shell\nUsage: exit"
    17  }