quit.lua 918 B

123456789101112131415161718192021222324252627282930
  1. return {
  2. summary = 'Quit the application.',
  3. description = [[
  4. Pushes an event to quit. An optional number can be passed to set the exit code for the
  5. application. An exit code of zero indicates normal termination, whereas a nonzero exit code
  6. indicates that an error occurred.
  7. ]],
  8. arguments = {
  9. {
  10. name = 'code',
  11. type = 'number',
  12. default = '0',
  13. description = 'The exit code of the program.'
  14. }
  15. },
  16. returns = {},
  17. notes = [[
  18. This function is equivalent to calling `lovr.event.push('quit', <args>)`.
  19. The event won't be processed until the next time `lovr.event.poll` is called.
  20. The `lovr.quit` callback will be called when the event is processed, which can be used to do any
  21. cleanup work. The callback can also return `false` to abort the quitting process.
  22. ]],
  23. related = {
  24. 'lovr.quit',
  25. 'lovr.event.poll',
  26. 'lovr.event.restart'
  27. }
  28. }