Skip to content

Instantly share code, notes, and snippets.

@chernjie
Created May 27, 2013 02:33
Show Gist options
  • Save chernjie/5654905 to your computer and use it in GitHub Desktop.
Save chernjie/5654905 to your computer and use it in GitHub Desktop.
Open files in Eclipse via Command Line
#!/bin/bash
case $1 in
-clean|clean)
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean
;;
*)
[ $# -gt 0 ] &&
FILES="$@" ||
while read _FILES
do
FILES="$FILES $_FILES"
done
for i in $FILES
do
[ -f $i ] || touch $i
done
open -a /Applications/eclipse/Eclipse.app/ $FILES
;;
esac
@chernjie
Copy link
Author

Usage:

$ eclipse file.txt
$ echo file.txt file2.txt | eclipse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment