repl.d.elv 1.1 KB

12345678910111213141516171819202122232425
  1. #elvdoc:var after-command
  2. #
  3. # A list of functions to call after each interactive command completes. There is one pre-defined
  4. # function used to populate the [`$edit:command-duration`](./edit.html#edit:command-duration)
  5. # variable. Each function is called with a single [map](https://elv.sh/ref/language.html#map)
  6. # argument containing the following keys:
  7. #
  8. # * `src`: Information about the source that was executed, same as what
  9. # [`src`](builtin.html#src) would output inside the code.
  10. #
  11. # * `duration`: A [floating-point number](https://elv.sh/ref/language.html#number) representing the
  12. # command execution duration in seconds.
  13. #
  14. # * `error`: An [exception](../ref/language.html#exception) object if the command terminated with
  15. # an exception, else [`$nil`](../ref/language.html#nil).
  16. #
  17. # @cf $edit:command-duration
  18. #elvdoc:var command-duration
  19. #
  20. # Duration, in seconds, of the most recent interactive command. This can be useful in your prompt
  21. # to provide feedback on how long a command took to run. The initial value of this variable is the
  22. # time to evaluate your [`rc.elv`](command.html#rc-file) before printing the first prompt.
  23. #
  24. # @cf $edit:after-command