| 1 | #!/bin/bash |
|---|
| 2 | # |
|---|
| 3 | # wrapper for perl-tags as called from Padre. |
|---|
| 4 | # Launches /usr/local/bin/perl-tags in the background and with a -d 2 parameter inserted. |
|---|
| 5 | # The resulting perltags file contains a great deal of duplication, but it's already |
|---|
| 6 | # mostly sorted, so run it through 'uniq' to delete the duplicates. This shortens my |
|---|
| 7 | # local perltags results from >18,000 lines to around 7,500. |
|---|
| 8 | # |
|---|
| 9 | # padre calls this with 'system' 'perl-tags' '-o' '$perltags' '$project_dir' |
|---|
| 10 | # so we're receiving "-o" "perltags" "projectdir" |
|---|
| 11 | # |
|---|
| 12 | |
|---|
| 13 | # check expectations. If not what I expect to see, bail and just run it with the |
|---|
| 14 | # parameters as provided. Otherwise, we override. |
|---|
| 15 | if [ X"$1" == X"-o" ]; then |
|---|
| 16 | TAGFILE="$2" |
|---|
| 17 | TMPTAG=`mktemp --tmpdir` |
|---|
| 18 | DIR="$3" |
|---|
| 19 | ( |
|---|
| 20 | /usr/local/bin/perl-tags -d 2 -o "$TMPTAG" "$DIR" && \ |
|---|
| 21 | uniq <"$TMPTAG" >"$TAGFILE" && rm "$TMPTAG" && \ |
|---|
| 22 | xmessage -nearmouse "$TAGFILE created." |
|---|
| 23 | ) & |
|---|
| 24 | else |
|---|
| 25 | /usr/local/bin/perl-tags -d 2 $* |
|---|
| 26 | fi |
|---|