examples/beep.lua
changeset 16 d6d32995832b
parent 8 fc9060b9b7cc
child 31 54957980a83a
--- a/examples/beep.lua	Tue Mar 03 23:20:29 2009 +0200
+++ b/examples/beep.lua	Tue Mar 03 23:39:53 2009 +0200
@@ -2,8 +2,7 @@
 
 beep_enable = false
 
--- FIXME: add generic cid generation routine
-boolean_cid = main.command ( 'beep',
+main.command ( 'beep',
 	function ( args )
 		local enable = yesno ( args )
 		if enable ~= nil then
@@ -16,7 +15,7 @@
 			hooks_d['hook-message-in'].beep = nil
 			print ( "Beep on message is disabled" )
 		end
-	end, { 'enable', 'disable', 'yes', 'no', 'true', 'false', 'on', 'off' } )
+	end, boolean_cid )
 
 commands_help['beep'] = "[enable|disable|on|off|yes|no|true|false]\n\nEnables or disables beeping on all messages.\nIf state is omitted, prints current state."