quit.lua 985 B

1234567891011121314151617181920212223242526272829303132333435
  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. code = {
  10. type = 'number',
  11. default = '0',
  12. description = 'The exit code of the program.'
  13. }
  14. },
  15. returns = {},
  16. variants = {
  17. {
  18. arguments = { 'code' },
  19. returns = {}
  20. }
  21. },
  22. notes = [[
  23. This function is equivalent to calling `lovr.event.push('quit', <args>)`.
  24. The event won't be processed until the next time `lovr.event.poll` is called.
  25. The `lovr.quit` callback will be called when the event is processed, which can be used to do any
  26. cleanup work. The callback can also return `false` to abort the quitting process.
  27. ]],
  28. related = {
  29. 'lovr.quit',
  30. 'lovr.event.poll',
  31. 'lovr.event.restart'
  32. }
  33. }