Skip to content

Commit

Permalink
add build db wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
kalyazin committed Apr 24, 2014
1 parent 747e547 commit d099d9d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/cscope.coffee
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
nexpect = require 'nexpect'


buildDb = (options, callback) ->
spawn = require('child_process').spawn

opts = ['-b']
opts.push '-i' + options.nameFile if options.nameFile
opts.push '-f' + options.refFile if options.refFile
proc = spawn 'cscope', opts, { cwd: options.cwd if options.cwd }

# proc.stderr.setEncoding 'utf8'
# proc.stderr.on 'data', (data) ->
# console.log 'data = ' + data

proc.on 'exit', (code, signal) ->
callback code

cmd =
findSymbol: '1'
findCallees: '2'
Expand Down Expand Up @@ -68,3 +84,4 @@ module.exports =
genericFind cmd.findIncluders, symbol, options, callback
findAssignments: (symbol, options, callback) ->
genericFind cmd.findAssignments, symbol, options, callback
buildDb: buildDb

0 comments on commit d099d9d

Please sign in to comment.