Derek Baum | 9944670 | 2010-05-13 17:32:34 +0000 | [diff] [blame] | 1 | # default gosh_profile |
| 2 | # only read if etc/gosh_profile doesn't exist relative to the System property |
| 3 | # gosh.home or failing that the current directory. |
| 4 | |
Derek Baum | 772d077 | 2010-06-24 21:20:30 +0000 | [diff] [blame] | 5 | # catch all exceptions from this script to avoid it aborting startup |
Derek Baum | 9944670 | 2010-05-13 17:32:34 +0000 | [diff] [blame] | 6 | try { |
Derek Baum | 772d077 | 2010-06-24 21:20:30 +0000 | [diff] [blame] | 7 | |
| 8 | # ensure gogo commands are found first |
| 9 | SCOPE = gogo:* |
| 10 | |
| 11 | # add methods on BundleContext object as commands |
| 12 | #addcommand context ${.context} (${.context} class) |
| 13 | # bug: above invokes (String, Object, String) instead of (String, Object, Class) |
| 14 | addcommand context ${.context} |
| 15 | |
| 16 | # add methods on System object as commands |
Derek Baum | d3d3eff | 2011-04-21 13:07:45 +0000 | [diff] [blame] | 17 | addcommand system (((${.context} bundles) 0) loadclass java.lang.System) |
Derek Baum | 772d077 | 2010-06-24 21:20:30 +0000 | [diff] [blame] | 18 | |
| 19 | # alias to print full stack trace |
| 20 | e = { $exception printStackTrace } |
| 21 | |
| 22 | ## disable console auto-formatting of each result |
| 23 | # you will then need to explicitly use the 'format' command |
| 24 | # to print the result of commands that don't write to stdout. |
| 25 | #.Gogo.format = false |
| 26 | |
| 27 | ## disable printing the formatted result of a command into pipelines |
| 28 | #.Format.Pipe = false |
| 29 | |
| 30 | # set prompt |
| 31 | prompt = 'g! ' |
| 32 | |
| 33 | # print welcome message |
Derek Baum | 9944670 | 2010-05-13 17:32:34 +0000 | [diff] [blame] | 34 | cat ($0 resolve motd) |
Derek Baum | 772d077 | 2010-06-24 21:20:30 +0000 | [diff] [blame] | 35 | } { |
| 36 | echo "$0: ERROR: $exception" |
Derek Baum | 9944670 | 2010-05-13 17:32:34 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | # end |