mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
83267cdd45
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@92560 467b73ca-7a2a-4603-9d3b-597d59a354a9
36 lines
651 B
JavaScript
36 lines
651 B
JavaScript
|
|
// JSpec - Shell - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)
|
|
|
|
;(function(){
|
|
|
|
var _quit = quit
|
|
|
|
Shell = {
|
|
|
|
// --- Global
|
|
|
|
main: this,
|
|
|
|
// --- Commands
|
|
|
|
commands: {
|
|
quit: ['Terminate the shell', function(){ _quit() }],
|
|
exit: ['Terminate the shell', function(){ _quit() }]
|
|
},
|
|
|
|
/**
|
|
* Start the interactive shell.
|
|
*
|
|
* @api public
|
|
*/
|
|
|
|
start : function() {
|
|
for (var name in this.commands)
|
|
if (this.commands.hasOwnProperty(name))
|
|
this.main.__defineGetter__(name, this.commands[name][1])
|
|
}
|
|
}
|
|
|
|
Shell.start()
|
|
|
|
})() |