Skip to content

Instantly share code, notes, and snippets.

@dhaley
Created June 25, 2013 17:59
Show Gist options
  • Save dhaley/5860753 to your computer and use it in GitHub Desktop.
Save dhaley/5860753 to your computer and use it in GitHub Desktop.
pcomplete-drush-commands
(defun drupal/pcomplete-drush-commands ()
"Return the most common drush commands by parsing the drush output."
(when drupal-drush-program
(with-temp-buffer
(let ((default-directory
"/Users/daha1836/data/releases/cu_registrar/dev"))
(call-process drupal-drush-program nil t nil
"--early=includes/complete.inc")
(goto-char 0)
(let (commands)
(while (re-search-forward
"^[[:blank:]]*\\([@]?[[:word:]-.]+\\)"
nil t)
(push (match-string-no-properties 1) commands))
(sort commands #'string<))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment