     isWholeWord     = @wholeWordToggle.getValue()
     # isRegExp        = @regExpToggle.getValue()
 
+    exts            = IDE.settings.editor.getAllExts()
+    include         = "\\*{#{exts.join ','}}"
+    exclureDirs     = Object.keys IDE.settings.editor.ignoreDirectories
+    exclureDirs     = " --exclude-dir=#{exclureDirs.join ' --exclude-dir='}"
 
-    exts = IDE.settings.editor.getAllExts()
-    include = "\\*{#{exts.join ','}}";
-    exclureDirs = Object.keys IDE.settings.editor.ignoreDirectories
-    exclureDirs = " --exclude-dir=#{exclureDirs.join ' --exclude-dir='}"
-
-    @searchText = @searchText.replace new RegExp "\\\'", "g", "'\\''"
-    @searchText = @searchText.replace /-/g, "\\-"
-
-    flags = [
-      '-s'         # Silent mode
-      '-r'         # Recursively search subdirectories listed.
-      '--color=never'   # Disable color output to get plain text
+    @searchText     = @searchText.replace new RegExp "\\\'", "g", "'\\''"
+    @searchText     = @searchText.replace /-/g, "\\-"
+    flags           = [
+      '-s'                           # Silent mode
+      '-r'                           # Recursively search subdirectories listed.
+      '-n'                           # Each output line is preceded by its relative line number in the file
+      '-A 3'                         # Print num lines of trailing context after each match.
+      '-B 3'                         # Print num lines of trailing context before each match.
+      '-i'                           # Match case insensitively
+      '-w'                           # Only match whole words
+      '--color=never'                # Disable color output to get plain text
       '--binary-files=without-match' # Do not search binary files
-      '-n'         # Each output line is preceded by its relative line number in the file
-      '-A 3'       # Print num lines of trailing context after each match.
-      '-B 3'       # Print num lines of trailing context before each match.
-      '-i'         # Match case insensitively
-      '-w'         # Only match whole words
     ]
 
     flags.splice flags.indexOf('-i'), 1  if isCaseSensitive

      @formatOutput res.stdout, @bound 'createResultsView'

  escapeShell: (str) ->
    str.replace(/([\\"'`$\s\(\)<>])/g, "\\$1");

  formatOutput: (output, callback = noop) ->
    # Regexes
    MAIN_LINE = /^:?([\s\S]+):(\d+):([\s\S]*)$/
    CONTEXT_LINE = /^([\s\S]+)\-(\d+)\-([\s\S]*)$/

    lines      = output.split '\n'
    formatted  = {}
    stats      = {
      numberOfMatches: 0,
      numberOfSearchedFiles: 0
    }

    formatted = lines
    .map (line) ->

  createResultsView: (result, stats) ->
    {searchText}    = this
    isCaseSensitive = @caseToggle.getValue()
    resultsView     = new IDE.ContentSearchResultView { result, stats, searchText, isCaseSensitive }

    @emit 'ViewNeedsToBeShown', resultsView
    @destroy()

