 #   hubot knife node show <name> - chef: Display node run_list et al
 #   hubot knife role show <name> - chef: Display role configurations et al
 #   hubot knife status - chef: Display status for all nodes
+#   hubot knife search <query> - chef: run a knife search with given query
+#   hubot knife search long <query> - chef: run a knife search with given query and return ALL attributes
 #   hubot node list - chef: Lists all nodes on chef server
 #   hubot node show <node> - chef: Get knife status of all nodes
 #   hubot uptime <server> - chef: Prints uptime per node

exec  = require('child_process').exec

execCommand = (msg, cmd) ->
  exec cmd, (error, stdout, stderr) ->
    msg.send error if error
    msg.send stdout
    msg.send stderr if stderr

    command = "knife status"

    msg.send "Outputing status for all nodes..."
    execCommand msg, command

  robot.respond /knife status (.*)$/i, (msg) ->
    query = msg.match[1]
    command = "knife status #{query}"

    msg.send "Outputing status for #{query}"
    execCommand msg, command

  robot.respond /node list$/i, (msg) ->
