package cmds
import (
"errors"
"os"
"strconv"
)
// exit the shell and returns the provided status
// if no status is specified returns 0
func exit(args []string) error {
status := 0
if len(args) > 1 {
var err error
status, err = strconv.Atoi(args[1])
if err != nil {
return errors.New("usage: exit (status)")
}
}
os.Exit(status)
return nil
}