Hacker News new | ask | show | jobs
by mercurial 4513 days ago
Autocompletion of make targets in the shell.
1 comments

I wrote my own completion for that :) Here is the pattern I use:

   run.sh

   build() {
     ...
   }

   test() {
     ...
   }

   deploy() {
     ...
   }

   # This lets you do ./run.sh build foo bar at the command 
   # line.  The autocomplete scans for functions in .sh files
   # and fills them in as the first arg.

   "$@"