fish-shell/doc_src/emit.txt

21 lines
627 B
Plaintext
Raw Normal View History

\section emit emit - Emit a generic event
\subsection block-synopsis Synopsis
2012-12-20 08:11:55 +08:00
<tt>emit EVENT_NAME [ARGUMENTS...]</tt>
\subsection emit-description Description
2012-12-20 08:11:55 +08:00
The emit builtin fires a generic fish event. Such events can be caught by special functions called event handlers. The arguments are passed to the event handlers as function arguments.
\subsection emit-example Example
The following code first defines an event handler for the generic
event named 'test_event', and then emits an event of that type.
<pre>function event_test --on-event test_event
2012-12-20 08:11:55 +08:00
echo event test: $argv
end
2012-12-20 08:11:55 +08:00
emit test_event something
</pre>