Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (20 sloc) 488 Bytes
nroonga = require('../lib/nroonga')
readline = require('readline')
db = if process.argv.length > 2
new nroonga.Database(process.argv[2])
else
new nroonga.Database()
rl = readline.createInterface(process.stdin, process.stdout)
prefix = '> '
rl.on 'line', (line) ->
try
data = db.commandSync line.trim()
if data?
console.log(data)
catch error
console.log(error)
rl.prompt()
rl.on 'close', ->
process.exit(0)
rl.setPrompt prefix, prefix.length
rl.prompt()
Something went wrong with that request. Please try again.