1 ! Copyright (C) 2008 William Schlieper
\r
2 ! See http://factorcode.org/license.txt for BSD license.
\r
4 USING: kernel vocabs.loader sequences strings splitting words irc.messages ;
\r
6 IN: irc.ui.commandparser
\r
8 : command ( string string -- string command )
\r
10 dup "irc.ui.commands" lookup
\r
12 [ " " append prepend "quote" "irc.ui.commands" lookup ] if* ;
\r
14 : parse-message ( string -- )
\r
15 "/" ?head [ " " split1 swap command ] [ "say" command ] if execute ;
\r